From: "Tim Peters" <tim.one@comcast.net> > 1. You really want PyObject_RichCompareBool in your example, not > PyObject_RichCompare. The former is much more efficient in some > cases (e.g., a total ordering on dicts is much hairer to determine > than just equality). Now you're really pulling my leg. PyObject_RichCompareBool is just: /* Return -1 if error; 1 if v op w; 0 if not (v op w). */ int PyObject_RichCompareBool(PyObject *v, PyObject *w, int op) { PyObject *res = PyObject_RichCompare(v, w, op); int ok; if (res == NULL) return -1; ok = PyObject_IsTrue(res); Py_DECREF(res); return ok; } How can that be more efficient that PyObject_RichCompare?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4