]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.9] bpo-42783: Documentation for asyncio.sleep(0) (GH-24002) (GH-24153)
authorKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Tue, 18 May 2021 22:31:27 +0000 (06:31 +0800)
committerGitHub <noreply@github.com>
Tue, 18 May 2021 22:31:27 +0000 (23:31 +0100)
Co-Authored-By: Simon Willison <swillison@gmail.com>
Doc/library/asyncio-task.rst

index 87133e4cab3074f3858b825bb4c0cd981e369b86..ca6e525e93597753ea691b29e69b2c6781f8908c 100644 (file)
@@ -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.