diff options
author | Guido van Rossum <guido@python.org> | 1995-04-06 14:46:51 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1995-04-06 14:46:51 (GMT) |
commit | e9df727176faca694b5ef4daf1f423acdc683c3d (patch) | |
tree | 720d561b0e48bc8f4e7bfb29c5528f744e153a57 /Objects | |
parent | f1bb33495024232d3b7d0d852436c66a875e21b2 (diff) | |
download | cpython-e9df727176faca694b5ef4daf1f423acdc683c3d.zip cpython-e9df727176faca694b5ef4daf1f423acdc683c3d.tar.gz cpython-e9df727176faca694b5ef4daf1f423acdc683c3d.tar.bz2 |
change comparing instance methods
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/classobject.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c index fd9da23..6ef17b2 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -1209,10 +1209,9 @@ static int instancemethod_compare(a, b) instancemethodobject *a, *b; { - int cmp = cmpobject(a->im_self, b->im_self); - if (cmp == 0) - cmp = cmpobject(a->im_func, b->im_func); - return cmp; + if (a->im_self != b->im_self) + return (a->im_self < b->im_self) ? -1 : 1; + return cmpobject(a->im_func, b->im_func); } static object * |