Skip to content

Commit 4b8cdfc

Browse files
authored
bpo-41879: Doc: Fix description of async for statement (GH-23548)
Fix the wording in the documentation of `async for` to correctly describe asynchronous iterables. This fix is relevant for version 3.7 onward.
1 parent 67b769f commit 4b8cdfc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Doc/reference/compound_stmts.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -796,12 +796,12 @@ The :keyword:`!async for` statement
796796
.. productionlist:: python-grammar
797797
async_for_stmt: "async" `for_stmt`
798798

799-
An :term:`asynchronous iterable` is able to call asynchronous code in its
800-
*iter* implementation, and :term:`asynchronous iterator` can call asynchronous
801-
code in its *next* method.
799+
An :term:`asynchronous iterable` provides an ``__aiter__`` method that directly
800+
returns an :term:`asynchronous iterator`, which can call asynchronous code in
801+
its ``__anext__`` method.
802802

803803
The ``async for`` statement allows convenient iteration over asynchronous
804-
iterators.
804+
iterables.
805805

806806
The following code::
807807

0 commit comments

Comments
 (0)