diff options
| author | Mark Shannon <mark@hotpy.org> | 2020-01-14 10:12:45 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-14 10:12:45 +0000 |
| commit | 9af0e47b1705457bb6b327c197f2ec5737a1d8f6 (patch) | |
| tree | 97378eee78d793d16bd19038d88371d776e720c3 /Doc/library | |
| parent | 62e3973395fb9fab2eb8f651bcd0fea4e695e1cf (diff) | |
| download | cpython-git-9af0e47b1705457bb6b327c197f2ec5737a1d8f6.tar.gz | |
bpo-39156: Break up COMPARE_OP into four logically distinct opcodes. (GH-17754)
Break up COMPARE_OP into four logically distinct opcodes:
* COMPARE_OP for rich comparisons
* IS_OP for 'is' and 'is not' tests
* CONTAINS_OP for 'in' and 'is not' tests
* JUMP_IF_NOT_EXC_MATCH for checking exceptions in 'try-except' statements.
Diffstat (limited to 'Doc/library')
| -rw-r--r-- | Doc/library/dis.rst | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 1f540d9507..d3124f973f 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -927,6 +927,20 @@ All of the following opcodes use their arguments. ``cmp_op[opname]``. +.. opcode:: IS_OP (invert) + + Performs ``is`` comparison, or ``is not`` if ``invert`` is 1. + + .. versionadded:: 3.9 + + +.. opcode:: CONTAINS_OP (invert) + + Performs ``in`` comparison, or ``not in`` if ``invert`` is 1. + + .. versionadded:: 3.9 + + .. opcode:: IMPORT_NAME (namei) Imports the module ``co_names[namei]``. TOS and TOS1 are popped and provide @@ -961,6 +975,13 @@ All of the following opcodes use their arguments. .. versionadded:: 3.1 +.. opcode:: JUMP_IF_NOT_EXC_MATCH (target) + + Tests whether the second value on the stack is an exception matching TOS, + and jumps if it is not. Pops two values from the stack. + + .. versionadded:: 3.9 + .. opcode:: JUMP_IF_TRUE_OR_POP (target) |
