[Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.
rhamph at gmail.com
Sun Mar 21 06:54:17 CET 2010
On Sat, Mar 20, 2010 at 22:48, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Nick Coghlan wrote:
>> Note that Antoine's point was that float("0.1") and
>> Decimal.from_float(0.1) should compare equal.
> That would mean that Decimal("0.1") != float("0.1"), which might be
> surprising to someone who didn't realise they were mixing floats
> and decimals.
Much like Fraction("0.1") != float("0.1") is surprising.
The only way to get rid of surprises around float is to get rid of
float, and that ain't happening.
Adam Olsen, aka Rhamphoryncus
More information about the Python-Dev