Larry Hasting wrote:
>> too late for 3.5.0
> How's that?
Well, for example... my change broke all buildbots.
I don't think that it's good idea to rush to fix Python 3.5 :-) This part of Python (handling timestamps, especially the rounding mode) is complex, I prefer to check for all buildbots and wait for some feedback from users (wait at least 2 weeks).
I reverted my change, another function must be changed:
$ python2 -c 'import datetime; print(datetime.timedelta(microseconds=0.5))'
0:00:00.000001
$ python3 -c 'import datetime; print(datetime.timedelta(microseconds=0.5))'
0:00:00
datetime.timedelta must also use the ROUND_HALF_UP method, as Python 2, instead of ROUND_HALF_EVEN (datetime.py uses the round() function).
$ python2 -c 'import datetime; print(datetime.timedelta(microseconds=1.5))'
0:00:00.000002
$ python3 -c 'import datetime; print(datetime.timedelta(microseconds=1.5))'
0:00:00.000002
I have to rework my patch to use ROUND_HALF_UP in datetime.timedelta(), datetime.datetime.fromtimestamp() and datetime.datetime.utcfromtimestamp(), and update test_datetime.