[Python-Dev] Object customization

Greg Stein gstein@lyra.org
Fri, 14 Apr 2000 14:48:27 -0700 (PDT)


On Fri, 14 Apr 2000, Vladimir Marangozov wrote:
>...
> 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).

This is uglier than attaching the metadata directly to the target that you
are describing! If you want to apply metadata to functions, then apply
them to the function! Don't shove them off in a separate structure.

You're the one talking about cleanliness, yet you suggest something that
is very poor from a readability, maintainability, and semantic angle. Ick.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/