Private/public module members

Duncan Booth me at privacy.net
Thu Jun 24 15:57:53 CEST 2004


elbertlev at hotmail.com (Elbert Lev) wrote in 
news:9418be08.0406240537.6404a96 at posting.google.com:

> Not only doc(foo) has '_c', '_private' and 'b', but one can call them
> from outside the module.
> It this "by design"?

Yes.

All that prefixing with an underscore or listing names in '__all__' is 
intended to do is to modify the behaviour of 'from foo import *'. It does 
not prevent access, or even restrict visibility in any way.




More information about the Python-list mailing list