8000 [3.9] bpo-42783: Documentation for asyncio.sleep(0) (GH-24002) (GH-24… · python/cpython@632b403 · GitHub
[go: up one dir, main page]

Skip to content

Commit 632b403

Browse files
[3.9] bpo-42783: Documentation for asyncio.sleep(0) (GH-24002) (GH-24153)
Co-Authored-By: Simon Willison <swillison@gmail.com>
1 parent c17ba23 commit 632b403

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Doc/library/asyncio-task.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,10 @@ Sleeping
293293
``sleep()`` always suspends the current task, allowing other tasks
294294
to run.
295295

296+
Setting the delay to 0 provides an optimized path to allow other
297+
tasks to run. This can be used by long-running functions to avoid
298+
blocking the event loop for the full duration of the function call.
299+
296300
.. deprecated-removed:: 3.8 3.10
297301
The *loop* parameter.
298302

0 commit comments

Comments
 (0)
0