[Python-3000] Total ordering and cmp (original) (raw)
Collin Winter collinw at gmail.com
Wed Mar 21 02:10:14 CET 2007
- Previous message: [Python-3000] Automated py3k doc builds
- Next message: [Python-3000] Total ordering and __cmp__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Quoting from the commit message for r51533, which removed the default ordering:
""" A general problem with getting lots of these tests to pass is the reality that for object types that have a natural total ordering, implementing cmp is much more convenient than implementing eq, ne, lt, and so on. Should we go back to allowing cmp to provide a total ordering? Should we provide some other way to implement rich comparison with a single method override? Alex proposed a key() method; I've considered a richcmp() method. Or perhaps cmp() just shouldn't be killed off... """
What's the status on this? FWIW, I would like to see cmp stay as a fallback measure if eq, ne, lt, etc aren't defined for total ordering purposes. I've run across this while trying to get the docs toolchain working, and I was initially shocked that cmp was no longer called.
Collin Winter
- Previous message: [Python-3000] Automated py3k doc builds
- Next message: [Python-3000] Total ordering and __cmp__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]