[issue8257] Decimal constructor to accept float

Mark Dickinson report at bugs.python.org
Fri Apr 2 11:17:16 CEST 2010


Mark Dickinson <dickinsm at gmail.com> added the comment:

Raymond, do you want this to go into 2.7 as well?  I'm assuming that we're not going to allow mixed-type float+decimal operations in 2.7.

Also, if we're doing this, it seems to me that all the reasons you give for the Decimal constructor accepting floats also apply to the Fraction constructor.

The patch looks fine to me.  The new testcase is specific to IEEE 754 binary64 floating-point format, so I'll slap a 'requires_IEEE_754' decorator on it (copying the definition from test_math.py), if that's okay.

----------

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


More information about the Python-bugs-list mailing list