summaryrefslogtreecommitdiffstats
path: root/Doc/reference
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-07-01 16:51:43 (GMT)
committerGitHub <noreply@github.com>2024-07-01 16:51:43 (GMT)
commit931c168219fc030d4b8a6986da4bb2a5a8ef91fa (patch)
tree678dd77e84fcdeaba268d4225b05e00a50bc1bde /Doc/reference
parent010bf92779d2938c21c33ec9d4d0cdb87dc80760 (diff)
downloadcpython-931c168219fc030d4b8a6986da4bb2a5a8ef91fa.zip
cpython-931c168219fc030d4b8a6986da4bb2a5a8ef91fa.tar.gz
cpython-931c168219fc030d4b8a6986da4bb2a5a8ef91fa.tar.bz2
[3.13] gh-114104: clarify asynchronous comprehension docs to match runtime behavior (GH-121175) (#121234)
gh-114104: clarify asynchronous comprehension docs to match runtime behavior (GH-121175) (cherry picked from commit 91313afdb392d0d6105e9aaa57b5a50112b613e7) Co-authored-by: Danny Yang <yangdanny97@users.noreply.github.com>
Diffstat (limited to 'Doc/reference')
-rw-r--r--Doc/reference/expressions.rst10
1 files changed, 6 insertions, 4 deletions
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index 872773f..95ece0e 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -218,10 +218,12 @@ A comprehension in an :keyword:`!async def` function may consist of either a
:keyword:`!for` or :keyword:`!async for` clause following the leading
expression, may contain additional :keyword:`!for` or :keyword:`!async for`
clauses, and may also use :keyword:`await` expressions.
-If a comprehension contains either :keyword:`!async for` clauses or
-:keyword:`!await` expressions or other asynchronous comprehensions it is called
-an :dfn:`asynchronous comprehension`. An asynchronous comprehension may
-suspend the execution of the coroutine function in which it appears.
+
+If a comprehension contains :keyword:`!async for` clauses, or if it contains
+:keyword:`!await` expressions or other asynchronous comprehensions anywhere except
+the iterable expression in the leftmost :keyword:`!for` clause, it is called an
+:dfn:`asynchronous comprehension`. An asynchronous comprehension may suspend the
+execution of the coroutine function in which it appears.
See also :pep:`530`.
.. versionadded:: 3.6