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