Message304969
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:00 | ncoghlan | set | recipients:
+ 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:00 | ncoghlan | set | messageid: <1508922240.03.0.213398074469.issue21720@psf.upfronthosting.co.za> |
2017-10-25 09:04:00 | ncoghlan | link | issue21720 messages |
2017-10-25 09:03:59 | ncoghlan | create | |
|