Eric Snow added the comment:

Guido describes the global invariant for *all* the forms of importing a 
submodule, including explicit relative imports:

> I just mean that for relative import
> there is no need to bind the submodule to the parent, is there?

But there *is* a reason. The submodule must still be an attribute of the parent 
package, because of the invariant that if you have sys.modules['foo'] and 
sys.modules['foo.bar'], the latter must appear as the 'bar' attribute of the 
former. This is an invariant of module loading, and (I feel I'm repeating 
myself) the form of import used does not affect loading.

----------
nosy: +eric.snow

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24029>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to