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

Function array_repr

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

Source from the content-addressed store, hash-verified

50
51
52NPY_NO_EXPORT PyObject *
53array_repr(PyArrayObject *self)
54{
55 static PyObject *repr = NULL;
56
57 if (PyArray_ReprFunction != NULL) {
58 return PyObject_CallFunctionObjArgs(PyArray_ReprFunction, self, NULL);
59 }
60
61 /*
62 * We need to do a delayed import here as initialization on module load
63 * leads to circular import problems.
64 */
65 npy_cache_import("numpy.core.arrayprint", "_default_array_repr", &repr);
66 if (repr == NULL) {
67 npy_PyErr_SetStringChained(PyExc_RuntimeError,
68 "Unable to configure default ndarray.__repr__");
69 return NULL;
70 }
71 return PyObject_CallFunctionObjArgs(repr, self, NULL);
72}
73
74
75NPY_NO_EXPORT PyObject *

Callers

nothing calls this directly

Calls 2

npy_cache_importFunction · 0.85

Tested by

no test coverage detected