| 3283 | } |
| 3284 | |
| 3285 | static PyObject * |
| 3286 | array_set_string_function(PyObject *NPY_UNUSED(self), PyObject *args, |
| 3287 | PyObject *kwds) |
| 3288 | { |
| 3289 | PyObject *op = NULL; |
| 3290 | int repr = 1; |
| 3291 | static char *kwlist[] = {"f", "repr", NULL}; |
| 3292 | |
| 3293 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oi:set_string_function", kwlist, &op, &repr)) { |
| 3294 | return NULL; |
| 3295 | } |
| 3296 | /* reset the array_repr function to built-in */ |
| 3297 | if (op == Py_None) { |
| 3298 | op = NULL; |
| 3299 | } |
| 3300 | if (op != NULL && !PyCallable_Check(op)) { |
| 3301 | PyErr_SetString(PyExc_TypeError, |
| 3302 | "Argument must be callable."); |
| 3303 | return NULL; |
| 3304 | } |
| 3305 | PyArray_SetStringFunction(op, repr); |
| 3306 | Py_RETURN_NONE; |
| 3307 | } |
| 3308 | |
| 3309 | static PyObject * |
| 3310 | array_set_ops_function(PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args), |
nothing calls this directly
no test coverage detected