[issue45362] dis does not work with the new optimized ops

Mark Shannon report at bugs.python.org
Mon Oct 4 10:46:12 EDT 2021


Mark Shannon <mark at hotpy.org> added the comment:

127 and 48 aren't instructions.
>>> opcode.stack_effect(48)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid opcode or oparg

So the output from dis seems correct.


>If not, how would it deal with co_code being modified?

The co_code attribute is immutable and read only. It cannot be modified.

Specialized instructions and super instructions are private to the interpreter.
If they are visible to Python code (not counting ctypes hacks), then that is a bug.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45362>
_______________________________________


More information about the Python-bugs-list mailing list