[Python-Dev] cmp(x,x) (original) (raw)
Tim Peters tim.one at comcast.net
Tue May 18 14:37:31 EDT 2004
- Previous message: [Python-Dev] cmp(x,x)
- Next message: [Python-Dev] cmp(x,x)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
>>> cmp(x,x) # x.cmp() is NOT called 0
[Gustavo Niemeyer]
This is odd. We'll have problems trying to implemnt a NaN following the convention of being not-equal to itself, for example.
That's what rich comparisons are for. There's no problem getting
x = somenan x = x False
in Python 2.4 (the result of that is currently a platform-dependent crapshoot, though).
cmp(x, y) doesn't make sense for objects having only a partial ordering, so I don't care cmp() does with a NaN.
- Previous message: [Python-Dev] cmp(x,x)
- Next message: [Python-Dev] cmp(x,x)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]