Message291486
Huh, interesting - I'd missed that the only part of the "from a.b import c" that IMPORT_FROM implements is the LOAD_ATTR variant that falls back to sys.modules. The prior adjustment to get IMPORT_NAME to return "a.b" instead of "a" happens inside that opcode based on the fact that a non-empty from_list was passed in.
So indeed, there's no new opcode needed - as Serhiy points out, the compiler just needs to emit IMPORT_FROM instead of LOAD_ATTR for this case. |
|
| Date |
User |
Action |
Args |
| 2017-04-11 12:09:13 | ncoghlan | set | recipients:
+ ncoghlan, barry, brett.cannon, THRlWiTi, eric.snow, serhiy.storchaka, Victor.Varvariuc |
| 2017-04-11 12:09:13 | ncoghlan | set | messageid: <1491912553.46.0.518206306957.issue30024@psf.upfronthosting.co.za> |
| 2017-04-11 12:09:13 | ncoghlan | link | issue30024 messages |
| 2017-04-11 12:09:13 | ncoghlan | create | |
|