From: Guido van Rossum Date: Fri, 4 Dec 1998 18:52:55 +0000 (+0000) Subject: When comparing bound methods, use identity test on the objects, X-Git-Tag: v1.5.2b1~121 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=13fdf5e9170929671ab1ab7e58ecc141b07dceca;p=python When comparing bound methods, use identity test on the objects, not equality test. --- diff --git a/Objects/methodobject.c b/Objects/methodobject.c index 672981fb78..e7de73aa7c 100644 --- a/Objects/methodobject.c +++ b/Objects/methodobject.c @@ -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)