Skip to content

Commit

Permalink
[3.13] gh-114104: clarify asynchronous comprehension docs to match ru…
Browse files Browse the repository at this point in the history
…ntime behavior (GH-121175) (#121234)

gh-114104: clarify asynchronous comprehension docs to match runtime behavior (GH-121175)
(cherry picked from commit 91313af)

Co-authored-by: Danny Yang <yangdanny97@users.noreply.github.com>
  • Loading branch information
miss-islington and yangdanny97 authored Jul 1, 2024
1 parent 010bf92 commit 931c168
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Doc/reference/expressions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 931c168

Please sign in to comment.