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

Function array_protocol_descr_get

numpy/core/src/multiarray/getset.c:203–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203static PyObject *
204array_protocol_descr_get(PyArrayObject *self)
205{
206 PyObject *res;
207 PyObject *dobj;
208
209 res = arraydescr_protocol_descr_get(PyArray_DESCR(self), NULL);
210 if (res) {
211 return res;
212 }
213 PyErr_Clear();
214
215 /* get default */
216 dobj = PyTuple_New(2);
217 if (dobj == NULL) {
218 return NULL;
219 }
220 PyTuple_SET_ITEM(dobj, 0, PyUnicode_FromString(""));
221 PyTuple_SET_ITEM(dobj, 1, array_typestr_get(self));
222 res = PyList_New(1);
223 if (res == NULL) {
224 Py_DECREF(dobj);
225 return NULL;
226 }
227 PyList_SET_ITEM(res, 0, dobj);
228 return res;
229}
230
231static PyObject *
232array_protocol_strides_get(PyArrayObject *self)

Callers 1

array_interface_getFunction · 0.85

Calls 3

PyArray_DESCRFunction · 0.85
array_typestr_getFunction · 0.85

Tested by

no test coverage detected