79755559

Date: 2025-09-04 10:04:42
Score: 1
Natty:
Report link

When you call asyncio.create_task(coro), the coroutine doesn’t just get registered. It is scheduled immediately on the event loop. That means the coroutine is started right away, up until its first await.

That’s why you see Do something with 1... printed immediately after creating task1: the event loop gives it a chance to run at least until it hits await asyncio.sleep(...). Same for task2.

Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): When you
  • Low reputation (1):
Posted by: Sten Overdijk