From 632b4034ab517b5d7f302c94fd9dc5a28c85f049 Mon Sep 17 00:00:00 2001 From: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Date: Wed, 19 May 2021 06:31:27 +0800 Subject: [3.9] bpo-42783: Documentation for asyncio.sleep(0) (GH-24002) (GH-24153) Co-Authored-By: Simon Willison --- Doc/library/asyncio-task.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index 87133e4..ca6e525 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. -- cgit v0.12