summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/dis.rst11
-rw-r--r--Doc/whatsnew/3.8.rst4
2 files changed, 15 insertions, 0 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst
index 47f226b..8f505e6 100644
--- a/Doc/library/dis.rst
+++ b/Doc/library/dis.rst
@@ -588,6 +588,17 @@ the original TOS1.
.. versionadded:: 3.5
+.. opcode:: END_ASYNC_FOR
+
+ Terminates an :keyword:`async for` loop. Handles an exception raised
+ when awaiting a next item. If TOS is :exc:`StopAsyncIteration` pop 7
+ values from the stack and restore the exception state using the second
+ three of them. Otherwise re-raise the exception using the three values
+ from the stack. An exception handler block is removed from the block stack.
+
+ .. versionadded:: 3.8
+
+
.. opcode:: BEFORE_ASYNC_WITH
Resolves ``__aenter__`` and ``__aexit__`` from the object on top of the
diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst
index fcc868b..4e6c851 100644
--- a/Doc/whatsnew/3.8.rst
+++ b/Doc/whatsnew/3.8.rst
@@ -157,3 +157,7 @@ CPython bytecode changes
(Contributed by Mark Shannon, Antoine Pitrou and Serhiy Storchaka in
:issue:`17611`.)
+
+* Added new opcode :opcode:`END_ASYNC_FOR` for handling exceptions raised
+ when awaiting a next item in an :keyword:`async for` loop.
+ (Contributed by Serhiy Storchaka in :issue:`33041`.)