From 507b4ed70c67f281a4ad51f8180f981b54857d41 Mon Sep 17 00:00:00 2001 From: Nick Gaya Date: Sat, 28 Nov 2020 20:27:16 -0800 Subject: [PATCH 1/4] bpo-41879: Doc: Fix description of async for statement --- Doc/reference/compound_stmts.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index 62986cb151964a..e8d6cfec83de63 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -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 *iter* method that returns an +:term:`asynchronous iterator, which can call asynchronous code in its *next* +method. The ``async for`` statement allows convenient iteration over asynchronous -iterators. +iterables. The following code:: From c0967e98879c43e65ba286036f5bd107a3b6c5e7 Mon Sep 17 00:00:00 2001 From: Nick Gaya Date: Sat, 28 Nov 2020 20:50:09 -0800 Subject: [PATCH 2/4] Fix typo --- Doc/reference/compound_stmts.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index e8d6cfec83de63..d92c245de9d387 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -797,7 +797,7 @@ The :keyword:`!async for` statement async_for_stmt: "async" `for_stmt` An :term:`asynchronous iterable` provides an *iter* method that returns an -:term:`asynchronous iterator, which can call asynchronous code in its *next* +:term:`asynchronous iterator`, which can call asynchronous code in its *next* method. The ``async for`` statement allows convenient iteration over asynchronous From dd74670354752b52306729f477426fb808eee2a9 Mon Sep 17 00:00:00 2001 From: Nick Gaya Date: Mon, 7 Dec 2020 00:03:57 -0800 Subject: [PATCH 3/4] Update wording per suggestion by @JulienPalard --- Doc/reference/compound_stmts.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index d92c245de9d387..59b06ee7d08578 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -796,9 +796,9 @@ The :keyword:`!async for` statement .. productionlist:: python-grammar async_for_stmt: "async" `for_stmt` -An :term:`asynchronous iterable` provides an *iter* method that returns an -:term:`asynchronous iterator`, which 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 iterables. From 88ff63cab406ae3ac2277921209eb5f3b6e353ab Mon Sep 17 00:00:00 2001 From: Nick Gaya Date: Mon, 7 Dec 2020 00:10:53 -0800 Subject: [PATCH 4/4] Fix markup --- Doc/reference/compound_stmts.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index 59b06ee7d08578..a55aacccc16dfe 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -796,9 +796,9 @@ The :keyword:`!async for` statement .. productionlist:: python-grammar async_for_stmt: "async" `for_stmt` -An :term:`asynchronous iterable` provides an `__aiter__` method that directly +An :term:`asynchronous iterable` provides an ``__aiter__`` method that directly returns an :term:`asynchronous iterator`, which can call asynchronous code in -its `__anext__` method. +its ``__anext__`` method. The ``async for`` statement allows convenient iteration over asynchronous iterables.