__all__ does not work?

skip at pobox.com skip at pobox.com
Tue May 9 21:16:33 EDT 2006


    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



More information about the Python-list mailing list