Issue 28297: sched module example has wrong output (original) (raw)

Issue28297

Created on 2016-09-28 09:31 by Arvind Padmanabhan, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg277600 - (view) Author: Arvind Padmanabhan (Arvind Padmanabhan) Date: 2016-09-28 09:31
Example in the sched module shows the following output: 930343690.257 From print_time 930343695.274 positional From print_time 930343695.275 keyword From print_time 930343700.273 default 930343700.276 But since "keyword" is scheduled with a higher priority (lower number), it should be printed first. URL: https://docs.python.org/3/library/sched.html Section: 17.6
msg277602 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-09-28 09:53
Though the delay arguments of keyword and positional are both 5, but their register time has tiny difference: 930343695.274 vs 930343695.275, so positional is printed first.
msg277603 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-09-28 10:00
Sorry, it's not 930343695.274 vs 930343695.275. I mean the register time is time.time() + delay, so there is tiny difference between the two. You can change the timefunc to lambda: int(time.time()), then you'll see keyword is printed first.
History
Date User Action Args
2022-04-11 14:58:37 admin set github: 72484
2016-09-28 10:51:13 xiang.zhang set status: open -> closedresolution: not a bugstage: resolved
2016-09-28 10:00:44 xiang.zhang set messages: +
2016-09-28 09:53:35 xiang.zhang set nosy: + xiang.zhangmessages: +
2016-09-28 09:31:39 Arvind Padmanabhan create