Message291377
The background here is the change in http://bugs.python.org/issue17636 that allows IMPORT_FROM to fall back to sys.modules when written as "from a.b import c as m", while the plain LOAD_ATTR generated for "import a.b.c as m" fails.
One potential resolution to the discrepancy that occurred to me in the python-ideas discussion was to add a new IMPORT_ATTR opcode specifically for use in the latter case.
The main downside I can see is the usual one with adding any new opcode for a niche use case like this one: it risks slowing the eval loop down in general for a marginal improvement in language consistency.
However, I don't think we should reject the possibility out of hand on that basis. |
|
Date |
User |
Action |
Args |
2017-04-09 12:11:14 | ncoghlan | set | recipients:
+ ncoghlan, brett.cannon, THRlWiTi, eric.snow, Victor.Varvariuc |
2017-04-09 12:11:13 | ncoghlan | set | messageid: <1491739873.97.0.306327834959.issue30024@psf.upfronthosting.co.za> |
2017-04-09 12:11:13 | ncoghlan | link | issue30024 messages |
2017-04-09 12:11:13 | ncoghlan | create | |
|