]> granicus.if.org Git - python/commitdiff
When comparing bound methods, use identity test on the objects,
authorGuido van Rossum <guido@python.org>
Fri, 4 Dec 1998 18:52:55 +0000 (18:52 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 4 Dec 1998 18:52:55 +0000 (18:52 +0000)
not equality test.

Objects/methodobject.c

index 672981fb7880e50984f66ad79f86b86202e679d1..e7de73aa7ca5cfd9b974aed6e7fbdeee2af93209 100644 (file)
@@ -160,7 +160,7 @@ meth_compare(a, b)
        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)