[Python-ideas] Standard (portable) bytecode "assembly" format

Ethan Furman ethan at stoneleaf.us
Fri Feb 26 13:23:45 EST 2016


On 02/26/2016 09:19 AM, Victor Stinner wrote:

> But it means that your code will probably starts with "from bytecode
> import *" or "from bytecode import LOAD_CONST, POP_TOP". There are
> something like 155 opcodes, so I would prefer to not have to write the
> exhaustive list of imports.

There is a reason that `from module import *` is still available, and 
this is one of them.

You could also put all the opcodes (and just the opcodes) into their own 
module to limit the `import *` reach:

     from bytecode.opcodes import *

--
~Ethan~



More information about the Python-ideas mailing list