Author ncoghlan
Recipients Victor.Varvariuc, brett.cannon, eric.snow, irdb, ncoghlan
Date 2017-04-09.12:11:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491739873.97.0.306327834959.issue30024@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-04-09 12:11:14ncoghlansetrecipients: + ncoghlan, brett.cannon, irdb, eric.snow, Victor.Varvariuc
2017-04-09 12:11:13ncoghlansetmessageid: <1491739873.97.0.306327834959.issue30024@psf.upfronthosting.co.za>
2017-04-09 12:11:13ncoghlanlinkissue30024 messages
2017-04-09 12:11:13ncoghlancreate