mirror of
https://github.com/python/cpython.git
synced 2025-11-02 11:08:57 +00:00
bpo-33346: Allow async comprehensions inside implicit async comprehensions (GH-6766)
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
This commit is contained in:
parent
0ee0a740e1
commit
054e9c84ac
6 changed files with 109 additions and 17 deletions
|
|
@ -218,9 +218,9 @@ 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 it is called an
|
||||
:dfn:`asynchronous comprehension`. An asynchronous comprehension may
|
||||
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.
|
||||
See also :pep:`530`.
|
||||
|
||||
|
|
@ -230,6 +230,11 @@ See also :pep:`530`.
|
|||
.. versionchanged:: 3.8
|
||||
``yield`` and ``yield from`` prohibited in the implicitly nested scope.
|
||||
|
||||
.. versionchanged:: 3.11
|
||||
Asynchronous comprehensions are now allowed inside comprehensions in
|
||||
asynchronous functions. Outer comprehensions implicitly become
|
||||
asynchronous.
|
||||
|
||||
|
||||
.. _lists:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue