[Python-ideas] [Python-Dev] The Case Against Floating Point ==

Imri Goldberg lorgandon at gmail.com
Thu Mar 13 23:18:35 CET 2008

Greg Ewing wrote:
> Imri Goldberg wrote:
>> what happens to other comparison 
>> operators, namely,
>> <=, <, >, >=. If they retain their original meaning than <= and >= 
>> become at least a bit inconsistent.
> Also, if you have <= and >= then you can cheat by
> doing 'x <= y and x >= y'. :-)

That's part of what I meant.

There's also the problem that if x>y, then you want x!=y. This means 
that there are implications for all comparison operators.

This makes changing == behavior to an epsilon comparison more involved. 
I still think it is feasible, but will require much more consideration.

In any case, emitting a warning for == is still 'cheap', and the 
original arguments stand.

Imri Goldberg
Insert Signature Here

More information about the Python-ideas mailing list