Sergey B Kirpichev <skirpic...@gmail.com> added the comment:

> Operations between decimals and floats raise a TypeError.

I saw this)  And as I said, I assume, the reason is: there is no lossless 
conversion to float's (and vice verse).

If so (point 2), neither multiple-precision type (e.g. gmpy2.mpfr) can subclass 
from the numbers.Real (there can be different precisions, different bases) and 
that sounds too restrictive.

>From the mathematician point of view, both built-in float's and Decimal's 
>could be viewed as (inexact!) representations for real numbers.  But if _any_ 
>such representations, conforming the numbers abc must be lossless converted to 
>each other - that might be a documentation issue.

> P.S.  With respect to #4, we've harmonized the APIs as much as we sensibly 
> can.

That was very minor, yes.  Something like try-except could be used here, trying 
as_integer_ratio().

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43602>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to