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

2021-10-05 Thread Ken Jin
Ken Jin added the comment: Closing this issue as the behavior in dis module is as intended. For any potential issues to 3rd party packages discovered in the future, consider opening an issue in that package's issue tracker, or submitting a brand new issue to bugs.python.org. --

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

2021-10-04 Thread Mark Shannon
Mark Shannon added the comment: 127 and 48 aren't instructions. >>> opcode.stack_effect(48) Traceback (most recent call last): File "", line 1, in ValueError: invalid opcode or oparg So the output from dis seems correct. >If not, how would it deal with co_code being modified? The

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

2021-10-04 Thread Ken Jin
Ken Jin added the comment: > Will this change be reflected in co_code? No. As per PEP 659: "Once any instruction in a code object has executed a few times, that code object will be "quickened" by allocating a new array for the bytecode that can be modified at runtime, and is not

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

2021-10-04 Thread Martmists
Martmists added the comment: > Specialized instructions are a hidden implementation detail, and instead the > normal generic instruction will appear. Will this change be reflected in co_code? If yes, then I'm aware of cases where this may be used by bytecode modification libraries. If not,

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

2021-10-04 Thread Ken Jin
Ken Jin added the comment: Thanks Martmists for the bug report, I'll try to address some of your concerns: > The reason for this seems to be the lack of definition in `opcode.py` aside > from being mentioned in _specialized_instructions. If I understood Mark's intentions in PEP 659

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

2021-10-04 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +Mark.Shannon, kj ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2021-10-04 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2021-10-04 Thread Martmists
Martmists added the comment: Another thing I found to be quite odd is JUMP_ABSOLUTE_QUICK, which is set as 40, but as it's derived from JUMP_ABSOLUTE it still requires an argument. This makes HAVE_ARGUMENT useless as there's an op that doesn't follow the convention. --

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

2021-10-04 Thread Martmists
New submission from Martmists : Python 3.11.0a0 (heads/main:e6d1aa1, Oct 4 2021, 10:33:36) [GCC 11.1.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import dis >>> c = bytes([127, 1, 0, 2]) # LOAD_FAST__LOAD_FAST (1, 2) >>> dis.dis(c) 0 <127>