Author vstinner
Recipients belopolsky, ethan.furman, mark.dickinson, r.david.murray, tbarbugli, vstinner
Date 2015-02-25.16:06:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1424880394.96.0.064125212034.issue23517@psf.upfronthosting.co.za>
In-reply-to
Content
I started a large change set to support nanoseconds in the C "pytime" API: see the issue #22117. While working on this change, I noticed that the rounding mode of datetime is currently wrong. Extract of a private patch:

typedef enum {
    /* Round towards zero. */
    _PyTime_ROUND_DOWN=0,
    /* Round away from zero.
       For example, used for timeout to wait "at least" N seconds. */
    _PyTime_ROUND_UP=1,
    /* Round towards minus infinity (-inf).
       For example, used for the system clock with UNIX epoch (time_t). */
    _PyTime_ROUND_FLOOR=2
} _PyTime_round_t;

I changed Modules/_datetimemodule.c to use _PyTime_ROUND_FLOOR, instead of _PyTime_ROUND_DOWN.
History
Date User Action Args
2015-02-25 16:06:35vstinnersetrecipients: + vstinner, mark.dickinson, belopolsky, r.david.murray, ethan.furman, tbarbugli
2015-02-25 16:06:34vstinnersetmessageid: <1424880394.96.0.064125212034.issue23517@psf.upfronthosting.co.za>
2015-02-25 16:06:34vstinnerlinkissue23517 messages
2015-02-25 16:06:34vstinnercreate