diff options
author | Brandt Bucher <brandtbucher@microsoft.com> | 2022-08-19 19:33:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-19 19:33:44 (GMT) |
commit | 5bfb3c372bda1113aea1385d4793f073a1d37155 (patch) | |
tree | a6b30a05ec2e5f59eadff759e47529ee76a6c132 /Doc/library/dis.rst | |
parent | 2d9f252c0c08bce0e776b38906c3bbb59a3bd2c5 (diff) | |
download | cpython-5bfb3c372bda1113aea1385d4793f073a1d37155.zip cpython-5bfb3c372bda1113aea1385d4793f073a1d37155.tar.gz cpython-5bfb3c372bda1113aea1385d4793f073a1d37155.tar.bz2 |
GH-90997: Wrap yield from/await in a virtual try/except StopIteration (GH-96010)
Diffstat (limited to 'Doc/library/dis.rst')
-rw-r--r-- | Doc/library/dis.rst | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 63b064e..691819f 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -567,6 +567,17 @@ the original TOS1. .. versionchanged:: 3.11 Exception representation on the stack now consist of one, not three, items. + +.. opcode:: CLEANUP_THROW + + Handles an exception raised during a :meth:`~generator.throw` or + :meth:`~generator.close` call through the current frame. If TOS is an + instance of :exc:`StopIteration`, pop three values from the stack and push + its ``value`` member. Otherwise, re-raise TOS. + + .. versionadded:: 3.12 + + .. opcode:: BEFORE_ASYNC_WITH Resolves ``__aenter__`` and ``__aexit__`` from the object on top of the @@ -1344,10 +1355,14 @@ iterations of the loop. .. versionadded:: 3.11 -.. opcode:: SEND +.. opcode:: SEND (delta) + + Equivalent to ``TOS = TOS1.send(TOS)``. Used in ``yield from`` and ``await`` + statements. - Sends ``None`` to the sub-generator of this generator. - Used in ``yield from`` and ``await`` statements. + If the call raises :exc:`StopIteration`, pop both items, push the + exception's ``value`` attribute, and increment the bytecode counter by + *delta*. .. versionadded:: 3.11 |