diff options
author | Guido van Rossum <guido@python.org> | 1998-12-04 18:52:55 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-12-04 18:52:55 (GMT) |
commit | 13fdf5e9170929671ab1ab7e58ecc141b07dceca (patch) | |
tree | 8502dc2173c2d254706696551da5c333dc93b146 /Objects/methodobject.c | |
parent | cf183acf15f7486978c2f37ad5864b50b7aafda2 (diff) | |
download | cpython-13fdf5e9170929671ab1ab7e58ecc141b07dceca.zip cpython-13fdf5e9170929671ab1ab7e58ecc141b07dceca.tar.gz cpython-13fdf5e9170929671ab1ab7e58ecc141b07dceca.tar.bz2 |
When comparing bound methods, use identity test on the objects,
not equality test.
Diffstat (limited to 'Objects/methodobject.c')
-rw-r--r-- | Objects/methodobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/methodobject.c b/Objects/methodobject.c index 672981f..e7de73a 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) |