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 ncoghlan
Recipients Julian.Gindi, Tim.Graham, berker.peksag, bignose, brett.cannon,, eric.snow, ezio.melotti, ncoghlan, python-dev, rhettinger, serhiy.storchaka
Date 2017-10-25.09:03:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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).
Date User Action Args
2017-10-25 09:04:00ncoghlansetrecipients: + ncoghlan, brett.cannon, rhettinger, ezio.melotti, bignose, python-dev, eric.snow, berker.peksag, serhiy.storchaka, Julian.Gindi,, Tim.Graham
2017-10-25 09:04:00ncoghlansetmessageid: <>
2017-10-25 09:04:00ncoghlanlinkissue21720 messages
2017-10-25 09:03:59ncoghlancreate