summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-11-03 10:01:36 (GMT)
committerGitHub <noreply@github.com>2023-11-03 10:01:36 (GMT)
commitd49aba5a7a3c695213810a9f82715809c6332df2 (patch)
treef949b9af90ff9d697ed2836efaea5b3b3e06e34c /Doc
parent7810b6981ac663b77bc9ee9dc4b1960ec6845ea7 (diff)
downloadcpython-d49aba5a7a3c695213810a9f82715809c6332df2.zip
cpython-d49aba5a7a3c695213810a9f82715809c6332df2.tar.gz
cpython-d49aba5a7a3c695213810a9f82715809c6332df2.tar.bz2
gh-111354: Simplify _PyGen_yf by moving some of its work to the compiler and frame state (#111648)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/dis.rst3
-rw-r--r--Doc/whatsnew/3.13.rst3
2 files changed, 4 insertions, 2 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst
index 1a5ca16..e44fa46 100644
--- a/Doc/library/dis.rst
+++ b/Doc/library/dis.rst
@@ -824,7 +824,8 @@ iterations of the loop.
oparg set to be the exception block depth, for efficient closing of generators.
.. versionchanged:: 3.13
- this opcode no longer has an oparg
+ oparg is ``1`` if this instruction is part of a yield-from or await, and ``0``
+ otherwise.
.. opcode:: SETUP_ANNOTATIONS
diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst
index 5ada880..aa693c6 100644
--- a/Doc/whatsnew/3.13.rst
+++ b/Doc/whatsnew/3.13.rst
@@ -948,7 +948,8 @@ Others
CPython bytecode changes
========================
-* ``YIELD_VALUE`` no longer has an oparg. The oparg of ``RESUME`` was
+* The oparg of ``YIELD_VALUE`` is now ``1`` if the yield is part of a
+ yield-from or await, and ``0`` otherwise. The oparg of ``RESUME`` was
changed to add a bit indicating whether the except-depth is 1, which
is needed to optimize closing of generators.
(Contributed by Irit Katriel in :gh:`111354`.)