MCPcopy Create free account
hub / github.com/numpy/numpy / array_set_ops_function

Function array_set_ops_function

numpy/core/src/multiarray/multiarraymodule.c:3309–3332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3307}
3308
3309static PyObject *
3310array_set_ops_function(PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args),
3311 PyObject *kwds)
3312{
3313 PyObject *oldops = NULL;
3314
3315 if ((oldops = _PyArray_GetNumericOps()) == NULL) {
3316 return NULL;
3317 }
3318 /*
3319 * Should probably ensure that objects are at least callable
3320 * Leave this to the caller for now --- error will be raised
3321 * later when use is attempted
3322 */
3323 if (kwds && PyArray_SetNumericOps(kwds) == -1) {
3324 Py_DECREF(oldops);
3325 if (PyErr_Occurred() == NULL) {
3326 PyErr_SetString(PyExc_ValueError,
3327 "one or more objects not callable");
3328 }
3329 return NULL;
3330 }
3331 return oldops;
3332}
3333
3334static PyObject *
3335array_set_datetimeparse_function(PyObject *NPY_UNUSED(self),

Callers

nothing calls this directly

Calls 2

_PyArray_GetNumericOpsFunction · 0.85
PyArray_SetNumericOpsFunction · 0.85

Tested by

no test coverage detected