Skip to content

Commit be9e440

Browse files
[3.9] bpo-41879: Doc: Fix description of async for statement (GH-23548) (GH-23749)
Fix the wording in the documentation of `async for` to correctly describe asynchronous iterables. This fix is relevant for version 3.7 onward. (cherry picked from commit 4b8cdfc) Co-authored-by: Nick Gaya <[email protected]>
1 parent c1a3f9a commit be9e440

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
@@ -799,12 +799,12 @@ The :keyword:`!async for` statement
799799
.. productionlist:: python-grammar
800800
async_for_stmt: "async" `for_stmt`
801801

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

806806
The ``async for`` statement allows convenient iteration over asynchronous
807-
iterators.
807+
iterables.
808808

809809
The following code::
810810

0 commit comments

Comments
 (0)