summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-09-18 20:38:53 (GMT)
committerGuido van Rossum <guido@python.org>2001-09-18 20:38:53 (GMT)
commitab3b0343b89b4683148dadaf89728ee1198ebee5 (patch)
treece2bc61bcef280a23bbc326fd7ec755a72bf1baa /Include
parenteb9490526508dc643c2329771f95a925e5412049 (diff)
downloadcpython-ab3b0343b89b4683148dadaf89728ee1198ebee5.zip
cpython-ab3b0343b89b4683148dadaf89728ee1198ebee5.tar.gz
cpython-ab3b0343b89b4683148dadaf89728ee1198ebee5.tar.bz2
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.
Diffstat (limited to 'Include')
-rw-r--r--Include/object.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Include/object.h b/Include/object.h
index d9c3514..160331e 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -346,6 +346,10 @@ extern DL_IMPORT(int) PyNumber_CoerceEx(PyObject **, PyObject **);
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(),
returning the names of the current locals. In this case, if there are