-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Description
Documentation
The docs for sched.scheduler have an example that uses time.time as the timefunc https://docs.python.org/3/library/sched.html#sched.scheduler
Using time.time instead of time.monotonic (the default value of sched.scheduler) creates the potential for "strange things" to happen when seasonal time shifts make the system clock go backwards, resulting in bugs in user's code.
It seems like it would be better to use time.monononic so as to introduce better practices to people learning the language.
Linked PRs
- gh-103417: use time.monotonic in the example for sched.scheduler #103418
- [3.11] gh-103417: use time.monotonic in the example for sched.scheduler (GH-103418) #103468
- gh-103417: Fix: infinite run (timefunc in scheduler example) #111497
- [3.12] gh-103417: Fix the scheduler example (GH-111497) #115908
- [3.11] gh-103417: Fix the scheduler example (GH-111497) #115909
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir