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.

Author vstinner
Recipients serhiy.storchaka, vstinner
Date 2017-10-15.09:40:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
I suggest to implement ROUND_UP in pytime and use it in all functions
accepting a timeout, not only poll. Search for ROUND_CEILING in the code to
find them. But functions accepting time like clock_settime() must continue

Does someone want to work on such patch? The new rounding mode must be test
in test_time, you should just add the new mode at the top once if I recall


select.poll currently uses ROUND_CEILING: round towards +infinity.

It looks like you would prefer ROUND_UP: round away from zero, right?

In the history of CPython, the rounding mode of functions accepting time,
timeout, duration, etc. changed many times, mostly because the C code
changed in subtle ways to fix different bugs. I mean that the exact
rounding mode wasn't really chosen on purpose. I'm now trying to get better
defined rouding modes in pytime, but it seems poll uses the wrong one.

I think that my problem is that I wanted to reuse the same rounding modes
for different use cases. It seems like clocks need ROUND_CEILING but
timeouts need ROUND_UP. Well, in the case of poll, the previous code before
moving to pytime was using ceil() which uses ROUND_CEILING.
Date User Action Args
2017-10-15 09:40:42vstinnersetrecipients: + vstinner, serhiy.storchaka
2017-10-15 09:40:42vstinnerlinkissue31786 messages
2017-10-15 09:40:41vstinnercreate