Nick Coghlan <ncogh...@gmail.com> added the comment:

I'm fine with the approach in the latest version of the PR - it does make "from 
x import y" slightly slower due to the extra error checking, but folks should 
be avoiding doing that in performance critical loops or functions anyway.

It would be nice if we could avoid that overhead for the import statement case, 
but we can't readily tell the difference between "__import__ called via syntax" 
and "__import__ called directly", and I don't think this is going to be 
performance critical enough to be worth introducing that complexity.

The question of how best to handle passing a consumable iterator as the from 
list would be a separate question, if we decided to do anything about it at all 
(the current implementation implicitly assumes the input is reiterable, but 
passing a non-container seems like a harder mistake to make than accidentally 
passing bytes instead of a string).

----------

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

Reply via email to