mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Merge branch changes (coercion, rich comparisons) into trunk.
This commit is contained in:
parent
33f4d6d1db
commit
2ed6bf87c9
4 changed files with 106 additions and 11 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue