Skip to content

Commit 7f2c5cf

Browse files
kovanmiss-islington
authored andcommitted
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 226eb88 commit 7f2c5cf

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)