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.
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 @@
.. 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