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 r.david.murray
Recipients Rolf Campbell, brett.cannon, eric.snow, ncoghlan, r.david.murray
Date 2018-05-16.21:40:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526506802.22.0.682650639539.issue33547@psf.upfronthosting.co.za>
In-reply-to
Content
It's importing 'a' from '.', which I guess in this context means from the current namespace (__main__), and a is 7.  You'll note that 'b' did get repointed, but it got repointed to what 'a' points to, instead of to 5.  If it really wasn't replacing the local, you'd get '7 5', not '7 7'.

So, this is weird but expected, I think.  You'll have to actually produce the example that doesn't involve __main__ if you want us to look in to that, but most likely it will be some similar phenomenon.

I'm not 100% sure this is the *desired* behavior of 'from . import', though, so I'm leaving this open for the import experts to look at.

Also, in 3.8 at least I get a warning from the import system, which is a clue something weird is going on :)
History
Date User Action Args
2018-05-16 21:40:02r.david.murraysetrecipients: + r.david.murray, brett.cannon, ncoghlan, eric.snow, Rolf Campbell
2018-05-16 21:40:02r.david.murraysetmessageid: <1526506802.22.0.682650639539.issue33547@psf.upfronthosting.co.za>
2018-05-16 21:40:02r.david.murraylinkissue33547 messages
2018-05-16 21:40:02r.david.murraycreate