New submission from Hrvoje Nikšić <hnik...@gmail.com>: Looking at the implementation and at the old issue at https://github.com/python/asyncio/issues/284 shows that asyncio.sleep special-cases asyncio.sleep(0) to mean "yield control to the event loop" without incurring additional overhead of sleeping. However, this is not documented at https://docs.python.org/3/library/asyncio-task.html#asyncio.sleep .
I propose to add to the documentation a statement along the lines of: """ A delay of 0 will relinquish control to the event loop, allowing other tasks and callbacks to run. The control will be returned to the coroutine as soon as they have run, without an explicit delay. """ ---------- assignee: docs@python components: Documentation, asyncio messages: 323949 nosy: asvetlov, docs@python, hniksic, yselivanov priority: normal severity: normal status: open title: asyncio.sleep(0) not documented versions: Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue34476> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com