summaryrefslogtreecommitdiffstats
path: root/Objects/complexobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-09-27 20:30:07 (GMT)
committerGuido van Rossum <guido@python.org>2001-09-27 20:30:07 (GMT)
commit2ed6bf87c9ce5d2e8a0eb33f7aa6503196205a0c (patch)
treecb597e3c84bf6d845c849e5d715a011922337704 /Objects/complexobject.c
parent33f4d6d1db5dd915cce811bd6f7a963d4dbe8db2 (diff)
downloadcpython-2ed6bf87c9ce5d2e8a0eb33f7aa6503196205a0c.zip
cpython-2ed6bf87c9ce5d2e8a0eb33f7aa6503196205a0c.tar.gz
cpython-2ed6bf87c9ce5d2e8a0eb33f7aa6503196205a0c.tar.bz2
Merge branch changes (coercion, rich comparisons) into trunk.
Diffstat (limited to 'Objects/complexobject.c')
-rw-r--r--Objects/complexobject.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index 32f2b24..ee0ede4 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);