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

Alexander Belopolsky report at bugs.python.org
Wed Sep 19 22:57:20 CEST 2012


Alexander Belopolsky added the comment:

On Wed, Sep 19, 2012 at 4:32 PM, Ram Rachum <report at bugs.python.org> wrote:
> But that number, 1.15, is stored in a Django decimal field.

My criticism was towards the idea that one may need to multiply
timedelta by a dollar amount or convert a dollar amount to a
timedelta.   Storing dollar amounts is an important use case for
Decimal and there are several reasons why Decimal is a better choice
than float for this.  On the other hand, I don't see why use of
Decimal would be required in your example.

Do you have any real world use cases where Decimal is clearly
preferred over float and there is a need to multiply Decimals by time
deltas?

----------

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


More information about the Python-bugs-list mailing list