This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.snow
Recipients barry, brett.cannon, eric.snow
Date 2015-04-22.18:33:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1429727606.47.0.435070301243.issue24029@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-04-22 18:33:26eric.snowsetrecipients: + eric.snow, barry, brett.cannon
2015-04-22 18:33:26eric.snowsetmessageid: <1429727606.47.0.435070301243.issue24029@psf.upfronthosting.co.za>
2015-04-22 18:33:26eric.snowlinkissue24029 messages
2015-04-22 18:33:26eric.snowcreate