Skip to content

Commit 7aeb10e

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 ac9bc7c commit 7aeb10e

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
@@ -758,6 +758,9 @@ Timeouts
758758
An :ref:`asynchronous context manager <async-context-managers>`
759759
for cancelling overdue coroutines.
760760

761+
Prefer using :func:`asyncio.timeout` or :func:`asyncio.timeout_at`
762+
rather than instantiating :class:`!Timeout` directly.
763+
761764
``when`` should be an absolute time at which the context should time out,
762765
as measured by the event loop's clock:
763766

0 commit comments

Comments
 (0)