From 2ed6bf87c9ce5d2e8a0eb33f7aa6503196205a0c Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 27 Sep 2001 20:30:07 +0000 Subject: Merge branch changes (coercion, rich comparisons) into trunk. --- Objects/complexobject.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Objects/complexobject.c') diff --git a/Objects/complexobject.c b/Objects/complexobject.c index 32f2b2459f..ee0ede4fc5 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -560,10 +560,8 @@ complex_richcompare(PyObject *v, PyObject *w, int op) 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); -- cgit v1.2.1