https://github.com/python/cpython/commit/b93386e1c4dbc871148e081ae147f7d1e8d21444 commit: b93386e1c4dbc871148e081ae147f7d1e8d21444 branch: 3.12 author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com> committer: kumaraditya303 <kumaradi...@python.org> date: 2024-07-01T16:41:18Z summary:
[3.12] gh-114104: clarify asynchronous comprehension docs to match runtime behavior (GH-121175) (#121235) gh-114104: clarify asynchronous comprehension docs to match runtime behavior (GH-121175) (cherry picked from commit 91313afdb392d0d6105e9aaa57b5a50112b613e7) Co-authored-by: Danny Yang <yangdann...@users.noreply.github.com> files: M Doc/reference/expressions.rst diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index 7c1dc6c0dc75ee..57a5bd13070940 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 _______________________________________________ Python-checkins mailing list -- python-checkins@python.org To unsubscribe send an email to python-checkins-le...@python.org https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: arch...@mail-archive.com