[Python-ideas] Allow 'import star' with namespaces

Guido van Rossum guido at python.org
Sat May 7 02:38:05 CEST 2011


The point is that the pkg should use __all__ to declare what submodules
exist. That's what it was invented for!
On May 6, 2011 3:05 PM, "Paul Moore" <p.f.moore at gmail.com> wrote:
> On 6 May 2011 21:52, Eric Snow <ericsnowcurrently at gmail.com> wrote:
>> He's saying that the package would be imported like normal.  Then all
>> "public" sub-modules of the package would automatically imported and
bound
>> to the namespace of the object that resulted from the import of the
package.
>
> There is no means of determining what submodules of a package exist.
> Check PEP 302 for details - finders find modules ant they can do so
> any way they like - there's nothing in the protocol to enumerate
> subpackages, so you can't do it (if faced with a general PEP 302
> finder).
>
> Paul.
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20110506/f3715d79/attachment.html>


More information about the Python-ideas mailing list