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, davidszotten@gmail.com, 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 <1508922240.03.0.213398074469.issue21720@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
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, davidszotten@gmail.com, Tim.Graham
2017-10-25 09:04:00ncoghlansetmessageid: <1508922240.03.0.213398074469.issue21720@psf.upfronthosting.co.za>
2017-10-25 09:04:00ncoghlanlinkissue21720 messages
2017-10-25 09:03:59ncoghlancreate