]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-142044: Add note to prefer `asyncio.timeout[_at]` over `asyncio.Timeout...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 7 Feb 2026 12:31:35 +0000 (13:31 +0100)
committerGitHub <noreply@github.com>
Sat, 7 Feb 2026 12:31:35 +0000 (13:31 +0100)
gh-142044: Add note to prefer `asyncio.timeout[_at]` over `asyncio.Timeout` (GH-144449)
(cherry picked from commit 0e7c06a85880ba790fac4239b0ff1052399a36ae)

Co-authored-by: kovan <xaum.io@gmail.com>
Doc/library/asyncio-task.rst

index 740f692d6a2a042de12ff768b0596b57b81e6eb8..3465f0c09ae41740e484f5e8d4429a4120d54492 100644 (file)
@@ -758,6 +758,9 @@ Timeouts
        An :ref:`asynchronous context manager <async-context-managers>`
        for cancelling overdue coroutines.
 
+       Prefer using :func:`asyncio.timeout` or :func:`asyncio.timeout_at`
+       rather than instantiating :class:`!Timeout` directly.
+
        ``when`` should be an absolute time at which the context should time out,
        as measured by the event loop's clock: