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

Brendan Moloney moloney at ohsu.edu
Thu May 5 23:41:06 CEST 2011


Hello,

I posted this on python-dev, but was told that this is the more appropriate list.

Currently if I do:

$ import pkg

Then all of the public subpackages/submodules are not automatically pulled into the 'pkg' namespace. I can do:

$ from pkg import *

To get all of the public subpackages/submodules, but that dumps them all into the current namespace. Why not allow:

$ import pkg.*

This would allow easier interactive use (by eliminating the need to import individual subpackages/submodules) while keeping the 'pkg' namespace around.

Thanks,
Brendan Moloney



More information about the Python-ideas mailing list