From bd2ec9e1422bcb5a09e41d32d90584395b522fa2 Mon Sep 17 00:00:00 2001 From: "M. Greyson Christoforo" Date: Sun, 31 May 2026 13:11:17 +0100 Subject: [PATCH] Clarify docs for scheduler.run(blocking=False) (GH-129575) (cherry picked from commit 2f8f569ba911ab3cff1356a15a3e688adc4ae917) Co-authored-by: M. Greyson Christoforo --- Doc/library/sched.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Doc/library/sched.rst b/Doc/library/sched.rst index 517dbe8c321898..44858c2c98782a 100644 --- a/Doc/library/sched.rst +++ b/Doc/library/sched.rst @@ -119,9 +119,11 @@ Scheduler Objects function passed to the constructor) for the next event, then execute it and so on until there are no more scheduled events. - If *blocking* is false executes the scheduled events due to expire soonest - (if any) and then return the deadline of the next scheduled call in the - scheduler (if any). + If *blocking* is false, immediately executes all events in the queue which have + a time value less than or equal to the current *timefunc* value (if any) and + returns the difference between the current *timefunc* value and the time value + of the next scheduled event in the scheduler's event queue. If the queue is + empty, returns ``None``. Either *action* or *delayfunc* can raise an exception. In either case, the scheduler will maintain a consistent state and propagate the exception. If an