Message323949
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.
""" |
|
Date |
User |
Action |
Args |
2018-08-23 14:41:27 | hniksic | set | recipients:
+ hniksic, asvetlov, docs@python, yselivanov |
2018-08-23 14:41:27 | hniksic | set | messageid: <1535035287.88.0.56676864532.issue34476@psf.upfronthosting.co.za> |
2018-08-23 14:41:27 | hniksic | link | issue34476 messages |
2018-08-23 14:41:27 | hniksic | create | |
|