mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
Issue #28008: Implement PEP 530 -- asynchronous comprehensions.
This commit is contained in:
parent
93b2dee80e
commit
52c4e7cc84
20 changed files with 623 additions and 124 deletions
|
@ -133,6 +133,24 @@ class TestAsyncAwait(GrammarTest):
|
|||
await x
|
||||
""")
|
||||
|
||||
self.validate("""async def foo():
|
||||
[i async for i in b]
|
||||
""")
|
||||
|
||||
self.validate("""async def foo():
|
||||
{i for i in b
|
||||
async for i in a if await i
|
||||
for b in i}
|
||||
""")
|
||||
|
||||
self.validate("""async def foo():
|
||||
[await i for i in b if await c]
|
||||
""")
|
||||
|
||||
self.validate("""async def foo():
|
||||
[ i for i in b if c]
|
||||
""")
|
||||
|
||||
self.validate("""async def foo():
|
||||
|
||||
def foo(): pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue