From: kovan Date: Sat, 7 Feb 2026 12:22:51 +0000 (+0100) Subject: gh-142044: Add note to prefer `asyncio.timeout[_at]` over `asyncio.Timeout` (#144449) X-Git-Tag: v3.15.0a6~42 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0e7c06a85880ba790fac4239b0ff1052399a36ae;p=thirdparty%2FPython%2Fcpython.git gh-142044: Add note to prefer `asyncio.timeout[_at]` over `asyncio.Timeout` (#144449) --- diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index 863b3e336572..1b7c8ff0c762 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: