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

Function array_str

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

Source from the content-addressed store, hash-verified

73
74
75NPY_NO_EXPORT PyObject *
76array_str(PyArrayObject *self)
77{
78 static PyObject *str = NULL;
79
80 if (PyArray_StrFunction != NULL) {
81 return PyObject_CallFunctionObjArgs(PyArray_StrFunction, self, NULL);
82 }
83
84 /*
85 * We need to do a delayed import here as initialization on module load leads
86 * to circular import problems.
87 */
88 npy_cache_import("numpy.core.arrayprint", "_default_array_str", &str);
89 if (str == NULL) {
90 npy_PyErr_SetStringChained(PyExc_RuntimeError,
91 "Unable to configure default ndarray.__str__");
92 return NULL;
93 }
94 return PyObject_CallFunctionObjArgs(str, self, NULL);
95}
96
97
98NPY_NO_EXPORT PyObject *

Callers

nothing calls this directly

Calls 2

npy_cache_importFunction · 0.85

Tested by

no test coverage detected