Skip Montanaro wrote: > > Barry's proposal would allow the Spam.eggs author to attach an attribute to > it: > > class Spam: > def eggs(self, a): > "doc" > return a > eggs.__zope_access__ = "private" > > I think the solution you're proposing is > > class Spam: > class EggsMethod: > def __call__(self, a): > "doc" > return a > __zope_access__ = "private" > eggs = EggsMethod() > > This seems to work, but also seems like a lot of extra baggage (and a > performance hit to boot) to arrive at what seems like a very simple concept. > If you prefer embedded definitions, among other things, you could do: __zope_access__ = { 'Spam' : 'public' } class Spam: __zope_access__ = { 'eggs' : 'private', 'eats' : 'public' } def eggs(self, ...): ... def eats(self, ...): ... or have a completely separate class/structure for access control (which is what you would do it in C, btw, for existing objects to which you can't add slots, ex: file descriptors, mem segments, etc). -- Vladimir MARANGOZOV | Vladimir.Marangozov@inrialpes.fr http://sirac.inrialpes.fr/~marangoz | tel:(+33-4)76615277 fax:76615252
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4