[issue8294] Allow Fraction constructor to accept float and decimal instances directly.

Mark Dickinson report at bugs.python.org
Fri Apr 2 23:07:08 CEST 2010


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

Unfortunately, that line is wrong (or at least incomplete), since decimals in exponential form are also accepted:

>>> Fraction('2.3e4')
Fraction(23000, 1)

I could try to reinstate a fixed version.

Attaching a second version of the patch:  same as the first, except for some doc tweaks.  (Rewording, markup fixes.)

----------
Added file: http://bugs.python.org/file16740/fraction_from_float2.patch

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


More information about the Python-bugs-list mailing list