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 ethan.glasser.camp, r.david.murray
Date 2013-10-09.18:28:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1381343299.58.0.0851639203166.issue19211@psf.upfronthosting.co.za>
In-reply-to
Content
I believe that this is because once you execute the first line, 'a' exists as a name in the 'lib' namespace, so 'from . import a' sees that 'a' already exists, and does nothing.  The same import sequence in abc.py will put 'a' into the 'abc' namespace, but 'from . import a' will be looking in the 'lib' namespace, won't see an 'a', and will do the new import, overwriting the definition of 'a' in the 'abc' namespace as it does so.

The exact effects of imports inside __init__ is sometimes a bit non-intuitive.
History
Date User Action Args
2013-10-09 18:28:19r.david.murraysetrecipients: + r.david.murray, ethan.glasser.camp
2013-10-09 18:28:19r.david.murraysetmessageid: <1381343299.58.0.0851639203166.issue19211@psf.upfronthosting.co.za>
2013-10-09 18:28:19r.david.murraylinkissue19211 messages
2013-10-09 18:28:19r.david.murraycreate