]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-101454: fix documentation for END_ASYNC_FOR (#101455)
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>
Wed, 1 Feb 2023 12:49:59 +0000 (12:49 +0000)
committerGitHub <noreply@github.com>
Wed, 1 Feb 2023 12:49:59 +0000 (12:49 +0000)
Doc/library/dis.rst

index 6a68ec4b14be31943b7790cbf12151dab963d78d..1fe2d5d6227d6156e6beb357bd84b25a41f0505e 100644 (file)
@@ -616,10 +616,9 @@ not have to be) the original ``STACK[-2]``.
 .. opcode:: END_ASYNC_FOR
 
    Terminates an :keyword:`async for` loop.  Handles an exception raised
-   when awaiting a next item.  If ``STACK[-1]`` is :exc:`StopAsyncIteration` pop 3
-   values from the stack and restore the exception state using the second
-   of them.  Otherwise re-raise the exception using the value
-   from the stack.  An exception handler block is removed from the block stack.
+   when awaiting a next item. The stack contains the async iterable in
+   ``STACK[-2]`` and the raised exception in ``STACK[-1]``. Both are popped.
+   If the exception is not :exc:`StopAsyncIteration`, it is re-raised.
 
    .. versionadded:: 3.8