Idea: __all__ in classes?

Carl Banks imbosol at vt.edu
Fri Jan 17 17:12:09 EST 2003


Michael Hudson wrote:
> [snip heresy <wink>]
>> With properties and metaclasses this should be fairly easy to
>> implement. (The private stuff I've already implemented with properties
>> a while back.)
> 
> How do you distinguish access from inside the class and access
> outside?

My guess is he uses the properties or the metaclass to wrap the
function defined in the class's scope, where the wrapper calls the
function with a proxy object (instead of the instance) that has access
to private variables.


-- 
CARL BANKS




More information about the Python-list mailing list