Skip to content

Commit 0e7c06a

Browse files
authored
gh-142044: Add note to prefer asyncio.timeout[_at] over asyncio.Timeout (#144449)
1 parent 16efaa2 commit 0e7c06a

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)