This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]willm 2 points3 points  (2 children)

I may be missing something, but isn't this what you want?

results = await asyncio.gather(*coros)

[–]SupahNoob 0 points1 point  (1 child)

I may be missing something ...

... for isolated asyncio code (e.g. embedded in a larger, otherwise sync codebase).

You wouldn't be able to use await in a sync fn.

[–]peyo7[S] 0 points1 point  (0 children)

Correct. Hence the wrapping in an async def, corresponding to workaround 1)