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 pje
Recipients Rhamphoryncus, brett.cannon, bronger, dcjim, eric.araujo, eric.snow, flox, jhylton, larry, loewis, ncoghlan, pje, sbt, tim.peters
Date 2013-12-17.17:30:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1387301459.67.0.676737035568.issue992389@psf.upfronthosting.co.za>
In-reply-to
Content
The new patch will have weird results in the case of a parent module that defines an attribute that's later replaced by an import, e.g. if foo/__init__.py defines a variable 'bar' that's a proxy for the foo.bar module.  This is especially problematic if this proxy is used during the process of importing foo.bar

At the very least, this code should NOT be deleting the original foo.bar attribute, but rather restoring its previous value.

All in all, I don't think this is a productive route to take.  It was discussed on Python-dev previously and IIRC I outlined all the other reasons why back then.  The approach in issue17636 is the only one that doesn't change the semantics of any existing, not-currently-broken code.

In contrast, the proposed change here introduces new side-effects and *more* volatile state and temporal coupling.  I don't think this should go in, since the other approach *only* affects execution paths that would currently raise ImportError.
History
Date User Action Args
2013-12-17 17:30:59pjesetrecipients: + pje, tim.peters, loewis, jhylton, brett.cannon, dcjim, ncoghlan, Rhamphoryncus, bronger, larry, eric.araujo, flox, sbt, eric.snow
2013-12-17 17:30:59pjesetmessageid: <1387301459.67.0.676737035568.issue992389@psf.upfronthosting.co.za>
2013-12-17 17:30:59pjelinkissue992389 messages
2013-12-17 17:30:58pjecreate