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

Function _arraydescr_isnative

numpy/core/src/multiarray/descriptor.c:2173–2197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2171}
2172
2173static int
2174_arraydescr_isnative(PyArray_Descr *self)
2175{
2176 if (!PyDataType_HASFIELDS(self)) {
2177 return PyArray_ISNBO(self->byteorder);
2178 }
2179 else {
2180 PyObject *key, *value, *title = NULL;
2181 PyArray_Descr *new;
2182 int offset;
2183 Py_ssize_t pos = 0;
2184 while (PyDict_Next(self->fields, &pos, &key, &value)) {
2185 if (NPY_TITLE_KEY(key, value)) {
2186 continue;
2187 }
2188 if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) {
2189 return -1;
2190 }
2191 if (!_arraydescr_isnative(new)) {
2192 return 0;
2193 }
2194 }
2195 }
2196 return 1;
2197}
2198
2199/*
2200 * return Py_True if this data-type descriptor

Callers 1

arraydescr_isnative_getFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected