Commit f92c095a authored by Kevin Modzelewski's avatar Kevin Modzelewski

Fix tp_richcompare optimization for dicts

I really hope this doesn't break anything, but in theory it's a compatibility break
(especially for C extensions).
parent 91e36eeb
......@@ -1071,7 +1071,15 @@ static PyObject* dict_richcompare(PyObject* v, PyObject* w, int op) noexcept {
1) < 0) {
return NULL;
}
res = incref(Py_NotImplemented);
// Pyston change: directly defer to tp_compare here, rather than letting
// PyObject_RichCompare do it.
// This is so that we can just embed a call to tp_richcompare rather than
// having to embed the full richcompare logic.
int c = dict_compare(static_cast<BoxedDict*>(v), static_cast<BoxedDict*>(w));
if (PyErr_Occurred())
return NULL;
return convert_3way_to_object(op, c);
}
return res;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment