[Python-checkins] [3.9] bpo-42783: Documentation for asyncio.sleep(0) (GH-24002) (GH-24153)
iritkatriel
webhook-mailer at python.org
Tue May 18 18:31:38 EDT 2021
https://github.com/python/cpython/commit/632b4034ab517b5d7f302c94fd9dc5a28c85f049
commit: 632b4034ab517b5d7f302c94fd9dc5a28c85f049
branch: 3.9
author: Ken Jin <28750310+Fidget-Spinner at users.noreply.github.com>
committer: iritkatriel <iritkatriel at yahoo.com>
date: 2021-05-18T23:31:27+01:00
summary:
[3.9] bpo-42783: Documentation for asyncio.sleep(0) (GH-24002) (GH-24153)
Co-Authored-By: Simon Willison <swillison at gmail.com>
files:
M Doc/library/asyncio-task.rst
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst
index 87133e4cab307..ca6e525e93597 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.
+
.. deprecated-removed:: 3.8 3.10
The *loop* parameter.
More information about the Python-checkins
mailing list