Brett Cannon added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17716>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to