[Python-checkins] CVS: python/dist/src/Include object.h,2.89,2.90

Guido van Rossum gvanrossum@users.sourceforge.net
Tue, 18 Sep 2001 13:38:55 -0700


Update of /cvsroot/python/python/dist/src/Include
In directory usw-pr-cvs1:/tmp/cvs-serv26332/Include

Modified Files:
	object.h 
Log Message:
Hopefully fix 3-way comparisons.  This unfortunately adds yet another
hack, and it's even more disgusting than a PyInstance_Check() call.
If the tp_compare slot is the slot used for overrides in Python,
it's always called.

Add some tests that show what should work too.


Index: object.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/object.h,v
retrieving revision 2.89
retrieving revision 2.90
diff -C2 -d -r2.89 -r2.90
*** object.h	2001/09/04 22:08:56	2.89
--- object.h	2001/09/18 20:38:53	2.90
***************
*** 347,350 ****
--- 347,354 ----
  extern DL_IMPORT(void) (*PyObject_ClearWeakRefs)(PyObject *);
  
+ /* A slot function whose address we need to compare */
+ extern int _PyObject_SlotCompare(PyObject *, PyObject *);
+ 
+ 
  /* PyObject_Dir(obj) acts like Python __builtin__.dir(obj), returning a
     list of strings.  PyObject_Dir(NULL) is like __builtin__.dir(),