Skip to content

Commit 539b024

Browse files
kovanclaude
andcommitted
gh-142044: Move timeout preference to class description
Move the guidance about preferring asyncio.timeout()/timeout_at() from a .. note:: block into the Timeout class description text, per reviewer feedback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 73df00f commit 539b024

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Doc/library/asyncio-task.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -766,16 +766,14 @@ Timeouts
766766
The context manager produced by :func:`asyncio.timeout` can be
767767
rescheduled to a different deadline and inspected.
768768

769-
.. note::
770-
771-
Prefer using :func:`asyncio.timeout` or :func:`asyncio.timeout_at`
772-
rather than instantiating :class:`Timeout` directly.
773-
774769
.. class:: Timeout(when)
775770

776771
An :ref:`asynchronous context manager <async-context-managers>`
777772
for cancelling overdue coroutines.
778773

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

0 commit comments

Comments
 (0)