From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sat, 7 Feb 2026 12:31:29 +0000 (+0100) Subject: [3.14] gh-142044: Add note to prefer `asyncio.timeout[_at]` over `asyncio.Timeout... X-Git-Tag: v3.14.4~319 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6b9c21cbeaf9a7bad98c11fe5dd73dd91e8e1339;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-142044: Add note to prefer `asyncio.timeout[_at]` over `asyncio.Timeout` (GH-144449) (#144565) gh-142044: Add note to prefer `asyncio.timeout[_at]` over `asyncio.Timeout` (GH-144449) (cherry picked from commit 0e7c06a85880ba790fac4239b0ff1052399a36ae) Co-authored-by: kovan --- diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index f825ae92ec74..5331db04aeb5 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -771,6 +771,9 @@ Timeouts An :ref:`asynchronous context manager ` 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: