3 ms·
Before the first await result1 the coroutine objects are in flight.
by samsquire 4y ago
Before the first await result1 the coroutine objects are in flight.
- Spivak 4y agoNope, creating the coroutines doesn’t schedule them for execution. That only happens on await. Python is not eager. If you want that behavior you need to use create_task. It doesn’t work like spawning a thread and waiting on them. From the docs: https://docs.python.org/3/library/asyncio-task.html https://docs.python.org/3/library/asyncio-task.html > Note that simply calling a coroutine will not schedule it to be executed:
- samsquire 4y agoOh this is not what I expected. I think on C# you can await threads which is similar to a join() with a return value.