[Python-Dev] Decimal <-> float comparisons in py3k.

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Mar 16 23:10:41 CET 2010

Mark Dickinson wrote:

> On the one hand there's something to be said for maintaining a clean
> separation between the float and Decimal types, allowing only explicit
> conversions from one to the other;  mixed-type arithmetic between
> floats and Decimals was very deliberately not permitted in the
> original PEP, and that's unlikely to change in a hurry.

I think that as long as you're disallowing arithmetic
between float and decimal, comparison should be disallowed
as well.

So if you're going to change anything, it would be better
to make such comparisons raise a TypeError in 2.7 to match
the current 3.x behaviour.


More information about the Python-Dev mailing list