[docs] [issue34476] asyncio.sleep(0) not documented
report at bugs.python.org
Thu Aug 23 10:41:27 EDT 2018
New submission from Hrvoje Nikšić <hniksic at 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 at python
components: Documentation, asyncio
nosy: asvetlov, docs at python, hniksic, yselivanov
title: asyncio.sleep(0) not documented
versions: Python 3.7
Python tracker <report at bugs.python.org>
More information about the docs