diff options
author | Mark Shannon <mark@hotpy.org> | 2022-11-03 11:38:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-03 11:38:51 (GMT) |
commit | f4adb975061874566766f7a67206cb7b0439bc11 (patch) | |
tree | 136b2e8b97fd8811cef1d2ff46d31fb61f26183a /Doc | |
parent | e9ac890c0273aee413aa528cc202c3efa29f1d7a (diff) | |
download | cpython-f4adb975061874566766f7a67206cb7b0439bc11.zip cpython-f4adb975061874566766f7a67206cb7b0439bc11.tar.gz cpython-f4adb975061874566766f7a67206cb7b0439bc11.tar.bz2 |
GH-96793: Implement PEP 479 in bytecode. (GH-99006)
* Handle converting StopIteration to RuntimeError in bytecode.
* Add custom instruction for converting StopIteration into RuntimeError.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/dis.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 1eaa9f3..30bbf95 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -607,6 +607,15 @@ the original TOS1. .. versionadded:: 3.12 +.. opcode:: STOPITERATION_ERROR + + Handles a StopIteration raised in a generator or coroutine. + If TOS is an instance of :exc:`StopIteration`, or :exc:`StopAsyncIteration` + replace it with a :exc:`RuntimeError`. + + .. versionadded:: 3.12 + + .. opcode:: BEFORE_ASYNC_WITH Resolves ``__aenter__`` and ``__aexit__`` from the object on top of the |