cpython/Objects
Guido van Rossum 47b9ff6ba1 Restructure comparison dramatically. There is no longer a default
*ordering* between objects; there is only a default equality test
(defined by an object being equal to itself only).  Read the comment
in object.c.  The current implementation never uses a three-way
comparison to compute a rich comparison, but it does use a rich
comparison to compute a three-way comparison.  I'm not quite done
ripping out all the calls to PyObject_Compare/Cmp, or replacing
tp_compare implementations with tp_richcompare implementations;
but much of that has happened (to make most unit tests pass).

The following tests still fail, because I need help deciding
or understanding:

test_codeop -- depends on comparing code objects
test_datetime -- need Tim Peters' opinion
test_marshal -- depends on comparing code objects
test_mutants -- need help understanding it

The problem with test_codeop and test_marshal is this: these tests
compare two different code objects and expect them to be equal.
Is that still a feature we'd like to support?  I've temporarily
removed the comparison and hash code from code objects, so they
use the default (equality by pointer only) comparison.

For the other two tests, run them to see for yourself.
(There may be more failing test with "-u all".)

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...
2006-08-24 00:41:19 +00:00
..
stringlib Partially merge trunk into p3yk. The removal of Mac/Tools is confusing svn 2006-06-08 14:42:34 +00:00
abstract.c Merge current trunk into p3yk. This includes the PyNumber_Index API change, 2006-08-21 19:07:27 +00:00
boolobject.c Get rid of most of the flags (in tp_flags) that keep track of various 2006-07-27 21:53:35 +00:00
bufferobject.c Restructure comparison dramatically. There is no longer a default 2006-08-24 00:41:19 +00:00
bytesobject.c Fix buglet in slice assignment of bytesobjects: assigning to b[3:0] ('stop' 2006-08-23 23:20:29 +00:00
cellobject.c Restructure comparison dramatically. There is no longer a default 2006-08-24 00:41:19 +00:00
classobject.c Restructure comparison dramatically. There is no longer a default 2006-08-24 00:41:19 +00:00
cobject.c Merge p3yk branch with the trunk up to revision 45595. This breaks a fair 2006-04-21 10:40:58 +00:00
codeobject.c Restructure comparison dramatically. There is no longer a default 2006-08-24 00:41:19 +00:00
complexobject.c Fix comparing complex to non-complex numbers. 2006-08-21 18:27:07 +00:00
descrobject.c Get rid of dict.has_key(). Boy this has a lot of repercussions! 2006-08-18 22:13:04 +00:00
dictnotes.txt Merged revisions 46753-51188 via svnmerge from 2006-08-11 14:57:12 +00:00
dictobject.c Restructure comparison dramatically. There is no longer a default 2006-08-24 00:41:19 +00:00
enumobject.c Merge p3yk branch with the trunk up to revision 45595. This breaks a fair 2006-04-21 10:40:58 +00:00
exceptions.c Merge current trunk into p3yk. This includes the PyNumber_Index API change, 2006-08-21 19:07:27 +00:00
fileobject.c Merged revisions 46753-51188 via svnmerge from 2006-08-11 14:57:12 +00:00
floatobject.c Get rid of most of the rest of coerce (slot is still there for now). 2006-08-21 17:06:07 +00:00
frameobject.c Merged revisions 46753-51188 via svnmerge from 2006-08-11 14:57:12 +00:00
funcobject.c Merged revisions 46753-51188 via svnmerge from 2006-08-11 14:57:12 +00:00
genobject.c Quite a few fixes to make the library and test suite more robust when 2006-08-17 20:24:18 +00:00
intobject.c Restructure comparison dramatically. There is no longer a default 2006-08-24 00:41:19 +00:00
iterobject.c Merge p3yk branch with the trunk up to revision 45595. This breaks a fair 2006-04-21 10:40:58 +00:00
listobject.c Restructure comparison dramatically. There is no longer a default 2006-08-24 00:41:19 +00:00
listsort.txt Merged revisions 46753-51188 via svnmerge from 2006-08-11 14:57:12 +00:00
longobject.c Restructure comparison dramatically. There is no longer a default 2006-08-24 00:41:19 +00:00
methodobject.c Restructure comparison dramatically. There is no longer a default 2006-08-24 00:41:19 +00:00
moduleobject.c Merge p3yk branch with the trunk up to revision 45595. This breaks a fair 2006-04-21 10:40:58 +00:00
object.c Restructure comparison dramatically. There is no longer a default 2006-08-24 00:41:19 +00:00
obmalloc.c Merge the rest of the trunk. 2006-06-08 15:35:45 +00:00
rangeobject.c Merge p3yk branch with the trunk up to revision 45595. This breaks a fair 2006-04-21 10:40:58 +00:00
setobject.c Completely get rid of PyClass and PyInstance. 2006-08-17 05:42:55 +00:00
sliceobject.c Restructure comparison dramatically. There is no longer a default 2006-08-24 00:41:19 +00:00
stringobject.c Merge current trunk into p3yk. This includes the PyNumber_Index API change, 2006-08-21 19:07:27 +00:00
structseq.c Merge current trunk into p3yk. This includes the PyNumber_Index API change, 2006-08-21 19:07:27 +00:00
tupleobject.c Merge current trunk into p3yk. This includes the PyNumber_Index API change, 2006-08-21 19:07:27 +00:00
typeobject.c Restructure comparison dramatically. There is no longer a default 2006-08-24 00:41:19 +00:00
unicodectype.c Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk. 2006-05-27 19:21:47 +00:00
unicodeobject.c Merge current trunk into p3yk. This includes the PyNumber_Index API change, 2006-08-21 19:07:27 +00:00
unicodetype_db.h Update Unicode database to Unicode 4.1. 2006-03-09 23:38:20 +00:00
weakrefobject.c Restructure comparison dramatically. There is no longer a default 2006-08-24 00:41:19 +00:00