[issue14660] Implement PEP 420: Implicit Namespace Packages

Brett Cannon report at bugs.python.org
Wed Apr 25 16:51:55 CEST 2012


Brett Cannon <brett at python.org> added the comment:

What do you mean the loader is only needed to set __loader__? You need the loader to create the module (or find it in sys.modules to reload), and set all the attributes properly. If you do this then reloading namespace modules will become a special case compared to other loaders as imp.reload() calls module.__loader__.load_module().

This also prevents the creation of an importlib.find_module() which would return the loader to replace imp.find_module() since you now split the API.

I realize the finder/loader dichotomy seems superfluous (and most of the time it is), but it has already been heavily exposed and relied on and deviating from it for namespace modules runs the risk of hurting introspection.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14660>
_______________________________________


More information about the Python-bugs-list mailing list