This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Wrong example result in docs
Type: Stage: resolved
Components: Documentation Versions: Python 3.8
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, hook, xtreak
Priority: normal Keywords:

Created on 2020-03-12 08:54 by hook, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg364004 - (view) Author: Tomas Hak (hook) Date: 2020-03-12 08:54
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"
msg364005 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2020-03-12 09:20
This seems to be a duplicate of issue28297 and issue34677.
msg364007 - (view) Author: Tomas Hak (hook) Date: 2020-03-12 09:32
I agree, it is duplicate.
History
Date User Action Args
2022-04-11 14:59:28adminsetgithub: 84126
2020-03-12 09:32:44hooksetstatus: open -> closed
resolution: not a bug
messages: + msg364007

stage: resolved
2020-03-12 09:20:26xtreaksetnosy: + xtreak
messages: + msg364005
2020-03-12 08:54:06hookcreate