]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41879: Doc: Fix description of async for statement (GH-23548)
authorNick Gaya <nicholasgaya+github@gmail.com>
Fri, 11 Dec 2020 08:27:35 +0000 (00:27 -0800)
committerGitHub <noreply@github.com>
Fri, 11 Dec 2020 08:27:35 +0000 (00:27 -0800)
Fix the wording in the documentation of `async for` to correctly describe asynchronous iterables.  This fix is relevant for version 3.7 onward.

Doc/reference/compound_stmts.rst

index 62986cb151964a88f26bd46d89cc436068ad3f66..a55aacccc16dfe59e42c352479400b4afacf1f61 100644 (file)
@@ -796,12 +796,12 @@ The :keyword:`!async for` statement
 .. productionlist:: python-grammar
    async_for_stmt: "async" `for_stmt`
 
-An :term:`asynchronous iterable` is able to call asynchronous code in its
-*iter* implementation, and :term:`asynchronous iterator` can call asynchronous
-code in its *next* method.
+An :term:`asynchronous iterable` provides an ``__aiter__`` method that directly
+returns an :term:`asynchronous iterator`, which can call asynchronous code in
+its ``__anext__`` method.
 
 The ``async for`` statement allows convenient iteration over asynchronous
-iterators.
+iterables.
 
 The following code::