[issue14262] Allow using decimals as arguments to `timedelta`

Alexander Belopolsky report at bugs.python.org
Tue Mar 13 17:11:30 CET 2012


Alexander Belopolsky <alexander.belopolsky at gmail.com> added the comment:

I am -0 on the feature and -1 on the implementation.  Conversion from Decimal to float is explicit by design.  Decimal gives the user fine control over rounding issues allowing for either exact arithmetics (trapping inexact operation) or one of several rounding modes.

This said, timedelta(<decimal>) is not much worse than float(<decimal>), so I will be only -0 if the implementation is such that (1) timedelta(<decimal>) does no loose precision over the entire range of timedelta and rounding is documented; and (2) implementaton does not require an explicit import decimal inside the datetime  module.

----------
type:  -> enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14262>
_______________________________________


More information about the Python-bugs-list mailing list