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 ncoghlan
Recipients brett.cannon, eric.snow, ncoghlan
Date 2016-01-16.04:52:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1452919932.74.0.634140737566.issue21762@psf.upfronthosting.co.za>
In-reply-to
Content
My concern is more about backwards compatibility - at the moment, you can alter the behaviour of import, pickle, and other subsystems by modifying the module level attributes, and if we switch to preferring the __spec__ attributes, then that kind of code will break (I added an import specific example related to __main__ module relative imports to the linked issue).

That's not to say it shouldn't be done - as you say, it would be nice to eventually get to a point where the import system only needs access to the module spec and not to the runtime state, and there are also cases where the __spec__ information will be more correct (e.g. pickling objects in __main__).

However, it needs to be in such a way that there are appropriate porting notes that explain to people why their state mutations stopped having the desired effect, and what (if anything) they can do instead.
History
Date User Action Args
2016-01-16 04:52:12ncoghlansetrecipients: + ncoghlan, brett.cannon, eric.snow
2016-01-16 04:52:12ncoghlansetmessageid: <1452919932.74.0.634140737566.issue21762@psf.upfronthosting.co.za>
2016-01-16 04:52:12ncoghlanlinkissue21762 messages
2016-01-16 04:52:12ncoghlancreate