Mercurial > cpython-lru_cache-weakref
diff Objects/complexobject.c @ 20140:225f17ec8932 legacy-trunk
Merge branch changes (coercion, rich comparisons) into trunk.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 27 Sep 2001 20:30:07 +0000 |
| parents | 2caddb82ffea |
| children | 2983b54256c7 |
line wrap: on
line diff
--- a/Objects/complexobject.c Thu Sep 27 20:11:07 2001 +0000 +++ b/Objects/complexobject.c Thu Sep 27 20:30:07 2001 +0000 @@ -560,10 +560,8 @@ Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } - /* May sure both arguments use complex comparison. - This implies PyComplex_Check(a) && PyComplex_Check(b). */ - if (v->ob_type->tp_richcompare != complex_richcompare || - w->ob_type->tp_richcompare != complex_richcompare) { + /* Make sure both arguments are complex. */ + if (!(PyComplex_Check(v) && PyComplex_Check(w))) { Py_DECREF(v); Py_DECREF(w); Py_INCREF(Py_NotImplemented);
