[Python-Dev] Add __exports__ to modules

Thomas Wouters thomas@xs4all.net
Thu, 11 Jan 2001 16:48:32 +0100


On Thu, Jan 11, 2001 at 04:33:28PM +0100, M.-A. Lemburg wrote:

> > Please don't use __all__.  At the moment, __all__ is the only way
> > to easily tell whether a particular module object really represents
> > a package, and the only way to get the list of submodule names.
> 
> But __all__ has to be user-defined, so I don't buy that argument.
> Note that the only true way to recognize a package is by looking
> for an attribute "__path__" since Python adds this for packages
> only.

Ehm.... What, exactly, prevents usercode from doing

__path__ = "neener, neener"

? In other words, even *that* isn't a true way to recognize a package. You
can see what isn't a package, but not what is.

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!