I also noticed that putting `await` before the async comprehension will make the code inside the comprehension run (though after it runs, it will fail on awaiting list):
>>> await [await asyncio.sleep(1, print(x)) for x in range(5)]
0
1
2
3
4
Traceback (most recent call last):
File "C:\Python38\lib\concurrent\futures\_base.py", line 439, in result
return self.__get_result()
File "C:\Python38\lib\concurrent\futures\_base.py", line 388, in __get_result
raise self._exception
File "<console>", line 1, in <module>
TypeError: object list can't be used in 'await' expression |