[issue36295] Need to yield (sleep(0)) twice in asyncio

2019-04-19 Thread Andrew Svetlov
Andrew Svetlov added the comment: In asyncio `await asyncio.sleep(0)` is for switching execution context from the current task to other code. There is no guarantee for finishing already running tasks before returning from `asyncio.sleep(0)` call etc. Also, your code snippet has a logical er

[issue36295] Need to yield (sleep(0)) twice in asyncio

2019-03-14 Thread Zachary Ware
Change by Zachary Ware : -- components: +asyncio nosy: +asvetlov, yselivanov ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue36295] Need to yield (sleep(0)) twice in asyncio

2019-03-14 Thread Assaf Dayan
New submission from Assaf Dayan : In asyncio, 'await asyncio.sleep(0)' is used to relinquish control and check for finished awaitables before continuing. In my example, an awaitable returns but is only handled if 'await asyncio.sleep(0)' is called twice (adjacently) and only then the returned