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

Reply via email to