[issue15136] Decimal accepting Fraction

Mark Dickinson report at bugs.python.org
Fri Jun 22 14:32:01 CEST 2012


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

> I guess my question is - should Decimal do this implicitly for Fraction?

I'd prefer not.  All other cases of Decimal construction (from float, from string, etc.) are lossless with results that don't depend on the current context;  construction from a Fraction will usually involve rounding, with results depending on the current rounding-mode and precision.

Having the division operation explicit (making it obvious that there's rounding involved) looks better to me.

----------
nosy: +mark.dickinson

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


More information about the Python-bugs-list mailing list