-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
Bytecode documentation issues for Python 3.12 #107457
Copy link
Copy link
Closed
Labels
3.12only security fixesonly security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dir
Description
As part of adding support for Python 3.12 to https://github.com/MatthieuDartiailh/bytecode I have identified a number of documentation issues both in the dismodule documentation in the bytecode section of the What's new in 3.12. Opening a separate issue for each point would just clutter the issue tracker so I will try to summarize all my findings here.
Issue in dis documentation
- COMPARE_OP oparg now uses the 4 lower bits as a cache. As a consequence:
- the statement
The operation name can be found in cmp_op[opname]is not true anymore. - the meaning of the cache is not documented but it can be != 0 even for a freshly compiled bytecode and as a consequence the difference is visible in
dis.disoutput
- the statement
-
MIN_INSTRUMENTED_OPCODEis not documented but needed to determine what are the "normal" opcodes -
LOAD_SUPER_ATTRdescription could use a code block to describe its stack effect IMO -
POP_JUMP_IF_NOT_NONEandPOP_JUMP_IF_NONEare still described as pseudo-instructions even though there are not anymore in 3.12 -
CALL_INSTRINSIC_2stack manipulation description looks wrong.
The description readsPasses STACK[-2], STACK[-1] as the arguments and sets STACK[-1] to the result, but the implementation pops 2 values from the stack -
END_SENDis not documented - how to account for the presence of
CACHEinstructions following jumping instructions is not described (FOR_ITER and SEND for the time being)
Issue in What's new
-
BINARY_SLICEis not mentioned -
STORE_SLICEis not mentioned -
CLEANUP_THROWis not mentioned -
RETURN_CONSTis not mentioned -
LOAD_FAST_CHECKis not mentioned -
END_SENDis not mentioned -
CALL_INSTRINSIC_1/2are not mentioned -
FOR_ITERnew behavior is not mentioned - The fact that
POP_JUMP_IF_*family of instructions are now real instructions is not mentioned -
YIELD_VALUEneed for an argument is not mentioned - The addition of
dis.hasexcis not mentioned
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dir