2016-04-14 0:11 GMT+02:00 Ryan Gonzalez email@example.com:
So code that depends on iterating through bytecode via HAS_ARG is going to break...
Sure. This change is backward incompatible for applications parsing bytecode in C or Python. That's why the patch also has to update the dis module.
I don't see how you plan to keep the backwad compatibility, since the argument size changed from 2 bytes to 1 byte. You must update your code (written in C or Python or whatever).
Hopefully, the dis was enhanced in Python 3.4: get_instructions() now gives nice Instructon objects rather than only pure text output.
FYI I wrote my own library to decode and decode bytecode. It provides abstract bytecode objects to easily modify bytecode: https://bytecode.readthedocs.org/
I suggest to use such library (or simply the dis module for simple needs) if you have to handle bytecode, rather than writing your own code.
I know a few other projects which handle directly bytecode:
IHMO it's not a big deal to update these projects for the future Python 3.6. I can even help them to support the new bytecode format.