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 brett.cannon
Recipients brett.cannon, eric.snow, ncoghlan
Date 2016-01-15.21:41:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
So I am going to disagree with Nick about the module attributes and their usefulness (partially because I just made __spec__.parent take precedence over __package__ in issue #25791). While I get the idea of wanting a history of what did (not) change since import, keeping the duplicate information around is annoying. And I don't know how truly useful it is to know what things were compared to what they became.

If we shift to preferring specs compared to module attributes we can then begin to clean up __import__ itself by no longer grabbing the globals() and locals() and instead simply pass in the module's __spec__ object. It also simplifies the documentation such that we don't have to explain everything twice. If people really want to track what a value was relating to import before mutation they can simply store it themselves instead of making us do the bookkeeping for them. It would also make things such as module_from_spec() or loader.create_module() simpler since they only have to worry about setting __spec__ instead of that attribute plus a bunch of other ones.
Date User Action Args
2016-01-15 21:41:08brett.cannonsetrecipients: + brett.cannon, ncoghlan, eric.snow
2016-01-15 21:41:08brett.cannonsetmessageid: <>
2016-01-15 21:41:08brett.cannonlinkissue21762 messages
2016-01-15 21:41:08brett.cannoncreate