diff Objects/methodobject.c @ 9592:2aafcee220bc legacy-trunk

When comparing bound methods, use identity test on the objects, not equality test.
author Guido van Rossum <guido@python.org>
date Fri, 04 Dec 1998 18:52:55 +0000
parents 9e536dd3dc97
children 5e6e9e893acd
line wrap: on
line diff
--- a/Objects/methodobject.c	Fri Dec 04 18:51:36 1998 +0000
+++ b/Objects/methodobject.c	Fri Dec 04 18:52:55 1998 +0000
@@ -160,7 +160,7 @@
 	PyCFunctionObject *a, *b;
 {
 	if (a->m_self != b->m_self)
-		return PyObject_Compare(a->m_self, b->m_self);
+		return (a->m_self < b->m_self) ? -1 : 1;
 	if (a->m_ml->ml_meth == b->m_ml->ml_meth)
 		return 0;
 	if (strcmp(a->m_ml->ml_name, b->m_ml->ml_name) < 0)