Skip to content

Commit 6b9c21c

Browse files
[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 0e7c06a) Co-authored-by: kovan <xaum.io@gmail.com>
1 parent 470e8f2 commit 6b9c21c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Doc/library/asyncio-task.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,9 @@ Timeouts
771771
An :ref:`asynchronous context manager <async-context-managers>`
772772
for cancelling overdue coroutines.
773773

774+
Prefer using :func:`asyncio.timeout` or :func:`asyncio.timeout_at`
775+
rather than instantiating :class:`!Timeout` directly.
776+
774777
``when`` should be an absolute time at which the context should time out,
775778
as measured by the event loop's clock:
776779

0 commit comments

Comments
 (0)