| 2210 | } |
| 2211 | |
| 2212 | static PyObject *Str_richcompare(PyObject *self, PyObject *other, int op) { |
| 2213 | |
| 2214 | sz_cptr_t a_start = NULL, b_start = NULL; |
| 2215 | sz_size_t a_length = 0, b_length = 0; |
| 2216 | if (!sz_py_export_string_like(self, &a_start, &a_length) || !sz_py_export_string_like(other, &b_start, &b_length)) |
| 2217 | Py_RETURN_NOTIMPLEMENTED; |
| 2218 | |
| 2219 | int order = (int)sz_order(a_start, a_length, b_start, b_length); |
| 2220 | switch (op) { |
| 2221 | case Py_LT: return PyBool_FromLong(order < 0); |
| 2222 | case Py_LE: return PyBool_FromLong(order <= 0); |
| 2223 | case Py_EQ: return PyBool_FromLong(order == 0); |
| 2224 | case Py_NE: return PyBool_FromLong(order != 0); |
| 2225 | case Py_GT: return PyBool_FromLong(order > 0); |
| 2226 | case Py_GE: return PyBool_FromLong(order >= 0); |
| 2227 | default: Py_RETURN_NOTIMPLEMENTED; |
| 2228 | } |
| 2229 | } |
| 2230 | |
| 2231 | static PyObject *Strs_richcompare(PyObject *self, PyObject *other, int op) { |
| 2232 |
nothing calls this directly
no test coverage detected
searching dependent graphs…