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 Pascal.Chambon, brett.cannon, eric.snow, ncoghlan
Date 2013-04-15.20:05:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1366056349.71.0.764209668196.issue17716@psf.upfronthosting.co.za>
In-reply-to
Content
Have to think about the whole rollback situation in terms of a failure to import a parent. Whenever you want to change the semantics of import you will break someone's code, it's just a question of how wide the breakage would be and how much of an improvement it will lead to. Probably cheapest way to tell is to implement it and see if the stdlib's test suite still passes.

In terms of implementation, I guess you would need to check if the import failed on a package (if possible), and then do a prefix search through all the keys in sys.modules to see if any children made it through, and then drop them and mention their import failure as well (probably through some exception chaining). It obviously makes failed exceptions more expensive, but I don't think people treat them as a cheap form of EAFP like other uses of exceptions.
History
Date User Action Args
2013-04-15 20:05:49brett.cannonsetrecipients: + brett.cannon, ncoghlan, eric.snow, Pascal.Chambon
2013-04-15 20:05:49brett.cannonsetmessageid: <1366056349.71.0.764209668196.issue17716@psf.upfronthosting.co.za>
2013-04-15 20:05:49brett.cannonlinkissue17716 messages
2013-04-15 20:05:49brett.cannoncreate