summaryrefslogtreecommitdiffstats
path: root/Doc/library/dis.rst
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-03-23 12:34:35 (GMT)
committerGitHub <noreply@github.com>2018-03-23 12:34:35 (GMT)
commit702f8f3611bc49b73772cce2b9b041bd11ff9b35 (patch)
treef712f53a42dc54831e7daf7e3686bc9c875b37b3 /Doc/library/dis.rst
parentc65bf3fe4a2bde424b79e350f36b7aaa3f6476f6 (diff)
downloadcpython-702f8f3611bc49b73772cce2b9b041bd11ff9b35.zip
cpython-702f8f3611bc49b73772cce2b9b041bd11ff9b35.tar.gz
cpython-702f8f3611bc49b73772cce2b9b041bd11ff9b35.tar.bz2
bpo-33041: Rework compiling an "async for" loop. (#6142)
* Added new opcode END_ASYNC_FOR. * Setting global StopAsyncIteration no longer breaks "async for" loops. * Jumping into an "async for" loop is now disabled. * Jumping out of an "async for" loop no longer corrupts the stack. * Simplify the compiler.
Diffstat (limited to 'Doc/library/dis.rst')
-rw-r--r--Doc/library/dis.rst11
1 files changed, 11 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