[issue11676] imp.load_module and submodules - doc issue, or bug?
Brett Cannon br...@python.org added the comment: It's actually not surprising that imp works this way: it predates packages. Because the semantics (I assume) have been like this for ages I say we document the current behavior (it's easy to work around) and simply continue to replace imp functionality with importlib ones that are more modern and reasonable. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11676 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11676] imp.load_module and submodules - doc issue, or bug?
Brett Cannon br...@python.org added the comment: I say it's a documentation bug. -- assignee: - docs@python components: +Documentation -Interpreter Core, Library (Lib) nosy: +brett.cannon, docs@python stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11676 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11676] imp.load_module and submodules - doc issue, or bug?
Dave Peck davep...@gmail.com added the comment: Definitely could agree with this assessment, but it is surprising given the lack of parallel behavior between 'import' and 'imp'. Note that imp.load_module(subpackage) _does_ modify the parent module's attributes -- but it will never put the subpackage attribute itself on parent. That's the part that made me think it shouldn't work this way and that its more bug than documentation. (That, and the specific use of the imp module in Google's dev_appserver.py which indicates that others have the same expectation of load_module() that I did.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11676 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11676] imp.load_module and submodules - doc issue, or bug?
Changes by Andreas Stührk andy-pyt...@hammerhartes.de: -- nosy: +Trundle ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11676 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11676] imp.load_module and submodules - doc issue, or bug?
New submission from Dave Peck davep...@gmail.com: If you use `import` to load a package and subpackage: import package import package.subpackage Then the `package` module instance will contain a `subpackage` attribute: assert subpackage in dir(sys.modules['package']), This works. But if you use Python's `imp` module to import these packages instead, the same assertion will fail. Is this a python documentation oversight, or a bug with the `imp` module? To reproduce, clone the associated hg repro and follow the instructions in the README file. Thanks! -- components: Interpreter Core, Library (Lib) hgrepos: 10 messages: 132162 nosy: Dave Peck priority: normal severity: normal status: open title: imp.load_module and submodules - doc issue, or bug? type: behavior versions: Python 2.5, Python 2.6, Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11676 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com