79578830

Date: 2025-04-17 08:47:10
Score: 0.5
Natty:
Report link

The behavior for me on Windows is

worker start
main exiting

on both 3.13 and 3.12. (Which is expected, and I suppose what you want)

Although, in response to your questions

  1. Your specific case does seem weird, but the specification of the abstract event loop doesn't guarantee any order in how switching between tasks are done

  2. I don't think so; the idea of the async await design is that you wouldn't (need to) care about how concurrent tasks are scheduled. You need to await an awaitable to get its result (make sure it runs to completion). In general, why would you want the behavior you described anyway? Usual event-loop implementations will run tasks "asap" anyway.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Akioweh