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

Function PyArray_OutputConverter

numpy/core/src/multiarray/conversion_utils.c:62–79  ·  view source on GitHub ↗

NUMPY_API * Useful to pass as converter function for O& processing in * PyArgs_ParseTuple for output arrays */

Source from the content-addressed store, hash-verified

60 * PyArgs_ParseTuple for output arrays
61 */
62NPY_NO_EXPORT int
63PyArray_OutputConverter(PyObject *object, PyArrayObject **address)
64{
65 if (object == NULL || object == Py_None) {
66 *address = NULL;
67 return NPY_SUCCEED;
68 }
69 if (PyArray_Check(object)) {
70 *address = (PyArrayObject *)object;
71 return NPY_SUCCEED;
72 }
73 else {
74 PyErr_SetString(PyExc_TypeError,
75 "output must be an array");
76 *address = NULL;
77 return NPY_FAIL;
78 }
79}
80
81
82/*

Callers 1

PyUFunc_GenericReductionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected