Message304689
Your async listcomp must also be defined within a coroutine to turn `async` into a keyword in 3.6. The following is far from best practice (don't do this, I don't know what I'm doing! :), but at least it compiles and shows that it works:
async def arange(n):
for i in range(n):
yield i
async def alistcomp():
return [i async for i in arange(10)]
try:
next(alistcomp().__await__())
except StopIteration as e:
value = e.value
print(value) |
|
Date |
User |
Action |
Args |
2017-10-20 23:31:13 | zach.ware | set | recipients:
+ zach.ware, yselivanov, cannedrag |
2017-10-20 23:31:13 | zach.ware | set | messageid: <1508542273.57.0.213398074469.issue31832@psf.upfronthosting.co.za> |
2017-10-20 23:31:13 | zach.ware | link | issue31832 messages |
2017-10-20 23:31:13 | zach.ware | create | |
|