Message 323949 - Python tracker

Message323949

Author hniksic
Recipients asvetlov, docs@python, hniksic, yselivanov
Date 2018-08-23.14:41:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1535035287.88.0.56676864532.issue34476@psf.upfronthosting.co.za>
In-reply-to
Content
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.
"""
History
Date User Action Args
2018-08-23 14:41:27hniksicsetrecipients: + hniksic, asvetlov, docs@python, yselivanov
2018-08-23 14:41:27hniksicsetmessageid: <1535035287.88.0.56676864532.issue34476@psf.upfronthosting.co.za>
2018-08-23 14:41:27hniksiclinkissue34476 messages
2018-08-23 14:41:27hniksiccreate