[Python-3000] Please re-add cmp to python 3000 (original) (raw)
Guido van Rossum guido at python.org
Tue Oct 30 01:05:41 CET 2007
- Previous message: [Python-3000] Please re-add __cmp__ to python 3000
- Next message: [Python-3000] Please re-add __cmp__ to python 3000
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
2007/10/29, Greg Ewing <greg.ewing at canterbury.ac.nz>:
David A. Wheeler wrote: > Greg Ewing stated "Why not provide a richcmp method that > directly connects with the corresponding type slot?
> It seems to me that this is the same as "cmp", No, it's not -- a richcmp method would take an extra argument specifying which of the six comparison operations to perform, and return a boolean instead of -1, 0, 1.
Eh? Shouldn't it return True, False or NotImplemented if that's the interface?
Giving it the same name as the old cmp would be confusing, I think.
For sure.
-- --Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-3000] Please re-add __cmp__ to python 3000
- Next message: [Python-3000] Please re-add __cmp__ to python 3000
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]