[issue40800] asyncio.sleep(0) should "yield" back to the event loop, but it doesn't behave as expected

2020-12-01 Thread Andrew Svetlov
Andrew Svetlov added the comment: Agree, not a bug. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___

[issue40800] asyncio.sleep(0) should "yield" back to the event loop, but it doesn't behave as expected

2020-12-01 Thread Bar Harel
Bar Harel added the comment: It relinquishes control for exactly one event loop cycle. You'll see that it takes two or three cycles and then gets cancelled correctly. The reason being is that recovery from your `await asyncio.sleep(1)` takes two or three cycles. (Under the hood, a few `async

[issue40800] asyncio.sleep(0) should "yield" back to the event loop, but it doesn't behave as expected

2020-05-27 Thread Davy Durham
New submission from Davy Durham : I was searching for a way to "yield" from task/coroutinue back to the event loop (not yielding a value in terms of a generator) and not finding anything documented, I found this bug report and PR: https://github.com/python/asyncio/issues/284 It states tha