summaryrefslogtreecommitdiffstats
path: root/Doc/library/dis.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/dis.rst')
-rw-r--r--Doc/library/dis.rst23
1 files changed, 22 insertions, 1 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst
index 63336bb..099b641 100644
--- a/Doc/library/dis.rst
+++ b/Doc/library/dis.rst
@@ -529,6 +529,9 @@ result back on the stack.
Implements ``STACK[-1] = not STACK[-1]``.
+ .. versionchanged:: 3.13
+ This instruction now requires an exact :class:`bool` operand.
+
.. opcode:: UNARY_INVERT
@@ -548,6 +551,13 @@ result back on the stack.
.. versionadded:: 3.5
+.. opcode:: TO_BOOL
+
+ Implements ``STACK[-1] = bool(STACK[-1])``.
+
+ .. versionadded:: 3.13
+
+
**Binary and in-place operations**
Binary operations remove the top two items from the stack (``STACK[-1]`` and
@@ -1127,7 +1137,12 @@ iterations of the loop.
.. opcode:: COMPARE_OP (opname)
Performs a Boolean operation. The operation name can be found in
- ``cmp_op[opname]``.
+ ``cmp_op[opname >> 5]``. If the fifth-lowest bit of ``opname`` is set
+ (``opname & 16``), the result should be coerced to ``bool``.
+
+ .. versionchanged:: 3.13
+ The fifth-lowest bit of the oparg now indicates a forced conversion to
+ :class:`bool`.
.. opcode:: IS_OP (invert)
@@ -1191,6 +1206,9 @@ iterations of the loop.
.. versionchanged:: 3.12
This is no longer a pseudo-instruction.
+ .. versionchanged:: 3.13
+ This instruction now requires an exact :class:`bool` operand.
+
.. opcode:: POP_JUMP_IF_FALSE (delta)
If ``STACK[-1]`` is false, increments the bytecode counter by *delta*.
@@ -1204,6 +1222,9 @@ iterations of the loop.
.. versionchanged:: 3.12
This is no longer a pseudo-instruction.
+ .. versionchanged:: 3.13
+ This instruction now requires an exact :class:`bool` operand.
+
.. opcode:: POP_JUMP_IF_NOT_NONE (delta)
If ``STACK[-1]`` is not ``None``, increments the bytecode counter by *delta*.