Nick Coghlan added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30024>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to