[issue15136] Decimal accepting Fraction

Terry J. Reedy report at bugs.python.org
Sat Aug 25 20:24:20 CEST 2012


Terry J. Reedy added the comment:

After reading the comments, I am ambivalent about a conversion function, and given the lack of consensus or even a clear majority, -1. (Which implies a change in issue title.)

I am +1 on using the new .format() machinery to have fractions format themselves. (Unless Python already does so for other purposes, it should do so without importing decimal.) The uploaded function passes the included test cases. I guess the rounding should be whatever we do for floats. I fudged that in the example.

----------
Added file: http://bugs.python.org/file26997/fracdec.py

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


More information about the Python-bugs-list mailing list