Hacker News new | ask | show | jobs
by rcxdude 209 days ago
They are async across operations that do 'yield', i.e. when the function eventually runs an i/o operation or sleep or similar. Those are the points where the functions can be interleaved. Simply awaiting another function is _not_ one of those points: await here only means the called function might yield to the scheduler at some point in its execution (it doesn't have to!), not that the calling function will yield immediately.
1 comments

Isn't asyncio.sleep one of those functions? "other" should be able to appear between "parent before" and "parent after".
Yes, but not between "parent before" and "child start" (or between "child end" and "parent after")
Ah, OK. That makes sense.