@@ -624,32 +624,26 @@ Timeouts
624
624
The context manager produced by :func: `asyncio.timeout ` can be
625
625
rescheduled to a different deadline and inspected.
626
626
627
- .. class :: Timeout()
627
+ .. class :: Timeout(when )
628
628
629
629
An :ref: `asynchronous context manager <async-context-managers >`
630
- that limits time spent inside of it .
630
+ for cancelling overdue coroutines .
631
631
632
- .. versionadded :: 3.11
632
+ ``when `` should be an absolute time at which the context should time out,
633
+ as measured by the event loop's clock:
634
+
635
+ - If ``when `` is ``None ``, the timeout will never trigger.
636
+ - If ``when < loop.time() ``, the timeout will trigger on the next
637
+ iteration of the event loop.
633
638
634
639
.. method :: when() -> float | None
635
640
636
641
Return the current deadline, or ``None `` if the current
637
642
deadline is not set.
638
643
639
- The deadline is a float, consistent with the time returned by
640
- :meth: `loop.time `.
641
-
642
644
.. method :: reschedule(when: float | None)
643
645
644
- Change the time the timeout will trigger.
645
-
646
- If *when * is ``None ``, any current deadline will be removed, and the
647
- context manager will wait indefinitely.
648
-
649
- If *when * is a float, it is set as the new deadline.
650
-
651
- if *when * is in the past, the timeout will trigger on the next
652
- iteration of the event loop.
646
+ Reschedule the timeout.
653
647
654
648
.. method :: expired() -> bool
655
649
0 commit comments