]> granicus.if.org Git - python/commit
Issue #23517: fromtimestamp() and utcfromtimestamp() methods of
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 8 Sep 2015 23:02:23 +0000 (01:02 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Tue, 8 Sep 2015 23:02:23 +0000 (01:02 +0200)
commit7667f58151d5efbbae4f0b1d7178f99dad0d74c0
tree99928f745f6377adbf42d8892f30ec1de75a2559
parent69cc487df42d9064a74551ae26a8c115dade3e3a
Issue #23517: fromtimestamp() and utcfromtimestamp() methods of
datetime.datetime now round microseconds to nearest with ties going to nearest
even integer (ROUND_HALF_EVEN), as round(float), instead of rounding towards
-Infinity (ROUND_FLOOR).

pytime API: replace _PyTime_ROUND_HALF_UP with _PyTime_ROUND_HALF_EVEN. Fix
also _PyTime_Divide() for negative numbers.

_PyTime_AsTimeval_impl() now reuses _PyTime_Divide() instead of reimplementing
rounding modes.
Include/pytime.h
Lib/datetime.py
Lib/test/datetimetester.py
Lib/test/test_time.py
Misc/NEWS
Modules/_datetimemodule.c
Modules/_testcapimodule.c
Python/pytime.c