Message315692
Given this async function:
async def elements(n):
yield n
yield n*2
yield n*3
yield n*4
This definition is considered invalid:
async def test():
return { n: [x async for x in elements(n)] for n in range(3)}
SyntaxError: asynchronous comprehension outside of an asynchronous function
The reason (I suspect) is because the dict comprehension is not an async context (it would be if range was an async iterable and we use `async for n in range(3)`).
Is this expected behaviour or something it needs to change? |
|
Date |
User |
Action |
Args |
2018-04-24 11:05:41 | pablogsal | set | recipients:
+ pablogsal, asvetlov, yselivanov |
2018-04-24 11:05:41 | pablogsal | set | messageid: <1524567941.57.0.682650639539.issue33346@psf.upfronthosting.co.za> |
2018-04-24 11:05:41 | pablogsal | link | issue33346 messages |
2018-04-24 11:05:41 | pablogsal | create | |
|