[Python-checkins] bpo-42783: Documentation for asyncio.sleep(0) (#24002)

ncoghlan webhook-mailer at python.org
Wed Jan 6 21:03:28 EST 2021


https://github.com/python/cpython/commit/5c30145afb6053998e3518befff638d207047f00
commit: 5c30145afb6053998e3518befff638d207047f00
branch: master
author: Simon Willison <swillison at gmail.com>
committer: ncoghlan <ncoghlan at gmail.com>
date: 2021年01月07日T12:03:18+10:00
summary:
bpo-42783: Documentation for asyncio.sleep(0) (#24002)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner at users.noreply.github.com>
files:
M Doc/library/asyncio-task.rst
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst
index 45e58437e0366..1ca1b4a06d7e8 100644
--- a/Doc/library/asyncio-task.rst
+++ b/Doc/library/asyncio-task.rst
@@ -293,6 +293,10 @@ Sleeping
 ``sleep()`` always suspends the current task, allowing other tasks
 to run.
 
+ Setting the delay to 0 provides an optimized path to allow other
+ tasks to run. This can be used by long-running functions to avoid
+ blocking the event loop for the full duration of the function call.
+
 .. _asyncio_example_sleep:
 
 Example of coroutine displaying the current date every second


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /