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

Function PyArray_SetStringFunction

numpy/core/src/multiarray/strfuncs.c:30–49  ·  view source on GitHub ↗

NUMPY_API * Set the array print function to be a Python function. */

Source from the content-addressed store, hash-verified

28 * Set the array print function to be a Python function.
29 */
30NPY_NO_EXPORT void
31PyArray_SetStringFunction(PyObject *op, int repr)
32{
33 if (repr) {
34 /* Dispose of previous callback */
35 Py_XDECREF(PyArray_ReprFunction);
36 /* Add a reference to new callback */
37 Py_XINCREF(op);
38 /* Remember new callback */
39 PyArray_ReprFunction = op;
40 }
41 else {
42 /* Dispose of previous callback */
43 Py_XDECREF(PyArray_StrFunction);
44 /* Add a reference to new callback */
45 Py_XINCREF(op);
46 /* Remember new callback */
47 PyArray_StrFunction = op;
48 }
49}
50
51
52NPY_NO_EXPORT PyObject *

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected