[issue1644818] Allow built-in packages and submodules as well as top-level modules
report at bugs.python.org
Thu Apr 29 15:43:47 CEST 2010
Nick Coghlan <ncoghlan at gmail.com> added the comment:
OK, reassessing with brain fully engaged this time: the current patch is incorrect, and this request is more complicated than one might initially think :)
It appears that since the patch was originally tried out only on Windows, a Modules/Setup based system based system like mine can't even build a patched tree. The current incarnation of the Modules/makesetup script won't allow the use of a dotted name for a module named in Modules/Setup.
Anyway, I'm uploading a more fleshed out test case which explicitly details some of the module namespace invariants that built-in packages would need to support (and changing the issue type and title accordingly).
Even beyond these stricter tests, pkgutil and importlib would need to be checked to make sure they also support the new behaviour.
Since I can't build the patch as it currently stands, I don't know how well it actually fairs against the stronger set of invariants. However, just looking at the patch I'm pretty confident that it doesn't include the necessary work to make sure that the parent package actually looks like a package from the interpreter's point of view.
stage: -> needs patch
title: Allow importing built-in submodules -> Allow built-in packages and submodules as well as top-level modules
type: behavior -> feature request
versions: -Python 2.6, Python 2.7, Python 3.1
Added file: http://bugs.python.org/file17126/test_builtin_submodule.py
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list