__all__ does not work?

AndyL ask at me
Tue May 9 22:37:06 EDT 2006


skip at pobox.com wrote:
>     Andy> This a mm.py module:
>     Andy> _all__=('getsize1',)
> 
>     Andy> size=85
> 
>     Andy> def getsize1():
>     Andy>      return size
> 
>     Andy> def getsize2():
>     Andy>      return 2*size
> 
> 
>     Andy> I do not know why but getsize2 is not kept priviate?
> 
> That's not what __all__ is used for.  Try this:
> 
>     from mm import *
> 
> The only name added to your namespace will be getsize1.
> 
> Skip

Okay, got it. Thx.



More information about the Python-list mailing list