[issue42783] asyncio.sleep(0) idiom is not documented
New submission from Simon Willison <swillison@gmail.com>: asyncio.sleep(0) is the recommended idiom for co-operatively yielding control of the event loop to another task: https://github.com/python/asyncio/issues/284 and https://til.simonwillison.net/python/yielding-in-asyncio This isn't currently explained in the documentation. ---------- assignee: docs@python components: Documentation, asyncio messages: 384025 nosy: asvetlov, docs@python, simonw, yselivanov priority: normal severity: normal status: open title: asyncio.sleep(0) idiom is not documented type: enhancement _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue42783> _______________________________________
Change by Simon Willison <swillison@gmail.com>: ---------- keywords: +patch pull_requests: +22845 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24002 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue42783> _______________________________________
Nick Coghlan <ncoghlan@gmail.com> added the comment: New changeset 5c30145afb6053998e3518befff638d207047f00 by Simon Willison in branch 'master': bpo-42783: Documentation for asyncio.sleep(0) (#24002) https://github.com/python/cpython/commit/5c30145afb6053998e3518befff638d2070... ---------- nosy: +ncoghlan _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue42783> _______________________________________
Nick Coghlan <ncoghlan@gmail.com> added the comment: I merged the update to the 3.10 docs, but the automated backport to 3.9 to update the online docs failed. ---------- resolution: -> fixed stage: patch review -> backport needed versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue42783> _______________________________________
Change by Ken Jin <kenjin4096@gmail.com>: ---------- nosy: +kj nosy_count: 5.0 -> 6.0 pull_requests: +22981 stage: backport needed -> patch review pull_request: https://github.com/python/cpython/pull/24153 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue42783> _______________________________________
participants (3)
-
Ken Jin -
Nick Coghlan -
Simon Willison