May 6, 2011
7:49 p.m.
dag.odenhall@gmail.com wrote:
I like this idea, except it's inconsistent with from-import-star, the latter which does *not* get you sub-packages or modules.
Georg Brandl [g.brandl@gmx.net] wrote:
And that's for a reason: it's not easy (I think it's even impossible, because for example individual submodules can change __path__) to determine all importable submodules of a package.
So ``import pkg.*`` would not have any behavior other than ``import pkg``.
When I said all _public_ sub-packages and modules I was referring to those listed in the __all__ attribute of 'pkg'. Thus it would behave in the exact same way as from-import-star except you don't pollute the current namespace. Brendan