Mark Shannon <[email protected]> added the comment:
Yes, this is change is deliberate.
PEP 626 states that *all* executed code gets traced.
Occasionally that will result in NOPs in the code, that are necessary
for correctness, but cannot be removed by the optimizer.
Is this a problem in practice?
In fact this NOP can be removed by rewriting the bytecode to:
2 0 LOAD_CONST 0 (10)
2 STORE_NAME 0 (x)
3 4 LOAD_CONST 3 (20)
5 6 STORE_NAME 2 (y)
8 LOAD_CONST 4 (None)
10 RETURN_VALUE
but that is a relatively rare case where the proceeding or following
instruction has no observable side-effects.
It is also non-trivial to implement, as the NOP and LOAD_CONST are in different
basic blocks.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue42693>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com