cpython/Include
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
..
Python-ast.h Merge p3yk branch with the trunk up to revision 45595. This breaks a fair 2006-04-21 10:40:58 +00:00
Python.h Completely get rid of PyClass and PyInstance. 2006-08-17 05:42:55 +00:00
abstract.h Merge current trunk into p3yk. This includes the PyNumber_Index API change, 2006-08-21 19:07:27 +00:00
asdl.h Merge p3yk branch with the trunk up to revision 45595. This breaks a fair 2006-04-21 10:40:58 +00:00
ast.h Merge from ast-arena. This reduces the code in Python/ast.c by ~300 lines, 2005-12-17 20:54:49 +00:00
bitset.h REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
boolobject.h SF bug 994255: Py_RETURN_NONE causes too much warnings 2004-07-22 01:46:43 +00:00
bufferobject.h Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
bytesobject.h Optimizations for bytes reallocation. 2006-05-05 04:34:18 +00:00
cStringIO.h Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
cellobject.h Wrote down the invariants of some common objects whose structure is 2004-10-28 16:32:00 +00:00
ceval.h Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
classobject.h Completely get rid of PyClass and PyInstance. 2006-08-17 05:42:55 +00:00
cobject.h Make CObjects mutable. Fixes #477441. 2003-10-19 18:30:01 +00:00
code.h Merge current trunk into p3yk. This includes the PyNumber_Index API change, 2006-08-21 19:07:27 +00:00
codecs.h Merge part of the trunk changes into the p3yk branch. This merges from 43030 2006-04-21 09:43:23 +00:00
compile.h Merge p3yk branch with the trunk up to revision 45595. This breaks a fair 2006-04-21 10:40:58 +00:00
complexobject.h SF # 607253, header file problems by Ralf W. Grosse-Kunstleve 2002-10-04 12:43:02 +00:00
datetime.h Add missing backslash for PyDateTimeAPI->Delta_FromDelta() macro. 2004-06-28 00:48:30 +00:00
descrobject.h SF 548651: Fix the METH_CLASS implementation. 2002-12-09 22:56:13 +00:00
dictobject.h Partially merge trunk into p3yk. The removal of Mac/Tools is confusing svn 2006-06-08 14:42:34 +00:00
enumobject.h Implement and apply PEP 322, reverse iteration 2003-11-06 14:06:48 +00:00
errcode.h Patch #802188: better parser error message for non-EOL following line cont. 2005-03-03 11:45:45 +00:00
eval.h - New function sys.call_tracing() allows pdb to debug code 2003-04-09 19:06:21 +00:00
fileobject.h Add weakref support to array.array and file objects. 2004-05-31 00:35:52 +00:00
floatobject.h This is my patch: 2005-05-27 15:23:20 +00:00
frameobject.h Merged revisions 46753-51188 via svnmerge from 2006-08-11 14:57:12 +00:00
funcobject.h Wrote down the invariants of some common objects whose structure is 2004-10-28 16:32:00 +00:00
genobject.h Merge p3yk branch with the trunk up to revision 45595. This breaks a fair 2006-04-21 10:40:58 +00:00
graminit.h PEP 343 -- the with-statement. 2006-02-27 22:32:47 +00:00
grammar.h REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
import.h Merge current trunk into p3yk. This includes the PyNumber_Index API change, 2006-08-21 19:07:27 +00:00
intobject.h Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
intrcheck.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
iterobject.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
listobject.h Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
longintrepr.h Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
longobject.h Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk. 2006-05-27 19:21:47 +00:00
marshal.h Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
metagrammar.h REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
methodobject.h Completely get rid of PyClass and PyInstance. 2006-08-17 05:42:55 +00:00
modsupport.h Merge p3yk branch with the trunk up to revision 45595. This breaks a fair 2006-04-21 10:40:58 +00:00
moduleobject.h Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00
node.h Patch #1440601: Add col_offset attribute to AST nodes. 2006-03-01 22:49:05 +00:00
object.h Restructure comparison dramatically. There is no longer a default 2006-08-24 00:41:19 +00:00
objimpl.h Get rid of most of the flags (in tp_flags) that keep track of various 2006-07-27 21:53:35 +00:00
opcode.h INPLACE_DIVIDE is no longer necessary (INPLACE_TRUE_DIVIDE is used). 2006-03-17 08:59:09 +00:00
osdefs.h Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk. 2006-05-27 19:21:47 +00:00
parsetok.h Checkpoint. 218 tests are okay; 53 are failing. Done so far: 2006-03-15 04:58:47 +00:00
patchlevel.h This gets at least test_cmd_line working again and a few more modules built. 2006-03-17 08:27:50 +00:00
pgen.h Changes from Jonathan Riehl to allow his pgen extension (PEP 269) to 2003-04-17 14:55:42 +00:00
pgenheaders.h Use Py_GCC_ATTRIBUTE instead of __attribute__. Compilers other than GCC 2002-09-15 14:09:54 +00:00
py_curses.h FreeBSD 5.x uses different wchar_t/win_t guards than earlier versions 2003-06-29 15:46:21 +00:00
pyarena.h Added words about what PyArena_Malloc() does. 2006-03-02 21:14:45 +00:00
pydebug.h _Py_QnewFlag and INPLACE_DIVIDE are not necessary any longer 2006-03-17 08:57:43 +00:00
pyerrors.h Merge current trunk into p3yk. This includes the PyNumber_Index API change, 2006-08-21 19:07:27 +00:00
pyexpat.h Merged revisions 46753-51188 via svnmerge from 2006-08-11 14:57:12 +00:00
pyfpe.h Some patches to Lee Busby's fpectl mods that accidentally didn't make it 1997-10-20 23:50:01 +00:00
pygetopt.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
pymactoolbox.h SF patch #1035255: Remove CoreServices / CoreFoundation dependencies in core 2004-11-05 07:02:59 +00:00
pymem.h Merge p3yk branch with the trunk up to revision 45595. This breaks a fair 2006-04-21 10:40:58 +00:00
pyport.h Merged revisions 46753-51188 via svnmerge from 2006-08-11 14:57:12 +00:00
pystate.h Merged revisions 46753-51188 via svnmerge from 2006-08-11 14:57:12 +00:00
pystrtod.h Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
pythonrun.h Checkpoint. 218 tests are okay; 53 are failing. Done so far: 2006-03-15 04:58:47 +00:00
pythread.h Merged revisions 46753-51188 via svnmerge from 2006-08-11 14:57:12 +00:00
rangeobject.h Remove PyRange_New(). 2004-12-03 11:45:13 +00:00
setobject.h Merged revisions 46753-51188 via svnmerge from 2006-08-11 14:57:12 +00:00
sliceobject.h Merge p3yk branch with the trunk up to revision 45595. This breaks a fair 2006-04-21 10:40:58 +00:00
stringobject.h Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
structmember.h Completely get rid of PyClass and PyInstance. 2006-08-17 05:42:55 +00:00
structseq.h Clean up some whitespace to be consistent with Python's C style. 2002-10-17 19:48:27 +00:00
symtable.h Merge the rest of the trunk. 2006-06-08 15:35:45 +00:00
sysmodule.h Use Py_GCC_ATTRIBUTE instead of __attribute__. Compilers other than GCC 2002-09-15 14:09:54 +00:00
timefuncs.h Bug 975996: Add _PyTime_DoubleToTimet to C API 2004-06-20 02:50:16 +00:00
token.h PEP-0318, @decorator-style. In Guido's words: 2004-08-02 06:10:11 +00:00
traceback.h Moved tracebackobject to traceback.h, Closes SF Bug #497067 2004-03-21 18:37:23 +00:00
tupleobject.h Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
ucnhash.h Avoid forward-declaring the methods array. 2006-03-10 11:20:04 +00:00
unicodeobject.h Merge current trunk into p3yk. This includes the PyNumber_Index API change, 2006-08-21 19:07:27 +00:00
weakrefobject.h Merged revisions 46753-51188 via svnmerge from 2006-08-11 14:57:12 +00:00