[issue39945] Wrong example result in docs

New submission from Tomas Hak <thak@tom-sec.com>: Step to reproduce: Open page: https://docs.python.org/3/library/sched.html Location: Documentation : sched — Event scheduler Description: In the text is definition of priority: "Events scheduled for the same time will be executed in the order of their priority. A lower number represents a higher priority." I assume it is correct, but example shows different behavior. There are scheduled two events with priority two and one. In print on the end of example, they are in wrong order : Code: s.enter(5, 2, print_time, argument=('positional',)) s.enter(5, 1, print_time, kwargs={'a': 'keyword'}) Current Result:
From print_time 930343695.274 positional From print_time 930343695.275 keyword
Expected result:
From print_time 930343695.274 keyword From print_time 930343695.275 positional
Conclusion : I tested the example code and it gave me expected result in order "keyword","positional" ---------- assignee: docs@python components: Documentation messages: 364004 nosy: docs@python, hook priority: normal severity: normal status: open title: Wrong example result in docs versions: Python 3.8 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39945> _______________________________________

Karthikeyan Singaravelan <tir.karthi@gmail.com> added the comment: This seems to be a duplicate of issue28297 and issue34677. ---------- nosy: +xtreak _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39945> _______________________________________

Tomas Hak <thak@tom-sec.com> added the comment: I agree, it is duplicate. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39945> _______________________________________
participants (2)
-
Karthikeyan Singaravelan
-
Tomas Hak