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 tim.peters
Recipients aconrad, belopolsky, larry, mark.dickinson, r.david.murray, tbarbugli, tim.peters, trcarden, vivanov, vstinner
Date 2015-08-29.02:08:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1440814098.73.0.541492246132.issue23517@psf.upfronthosting.co.za>
In-reply-to
Content
> IMHO we should only modify the rounding method used by
> datetime.datetime.fromtimestamp() and
> datetime.datetime.utcfromtimestamp(), other functions
> use the "right" rounding method.

Fine by me.  How about today? ;-)

The regression reported here must get repaired.  nearest/even is generally favored when there's a choice.

I personally _prefer_ add-a-half-and-chop in time contexts that need rounding, because it's more uniform.  That is, picturing a context that rounds to 1 digit for clarity, using a decimal system, with a uniformly spaced sequence of inputs on the first line, then a line with add-a-half-and-chop results, and then a line with nearest/even results:

0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 input
0.0 1.0 1.0 2.0 2.0 3.0 3.0 4.0 add-a-half-and-chop
0.0 0.0 1.0 2.0 2.0 2.0 3.0 4.0 nearest/even

From the last (nearest/even) line, you'd never guess that the inputs were uniformly spaced; in the second line, you would.  nearest/even's "in a tie, sometimes go up, sometimes go down" is, IMO, unnatural in this context.

But it doesn't make a lick of real difference to timestamp functions.  We're not working in decimal, and people aren't going to be staring at hex patterns in output.  So I'd pick whichever is easier to implement.
History
Date User Action Args
2015-08-29 02:08:18tim.peterssetrecipients: + tim.peters, mark.dickinson, belopolsky, vstinner, larry, r.david.murray, aconrad, vivanov, tbarbugli, trcarden
2015-08-29 02:08:18tim.peterssetmessageid: <1440814098.73.0.541492246132.issue23517@psf.upfronthosting.co.za>
2015-08-29 02:08:18tim.peterslinkissue23517 messages
2015-08-29 02:08:17tim.peterscreate