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

Function PyArray_DescrHash

numpy/core/src/multiarray/hashdescr.c:299–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297}
298
299NPY_NO_EXPORT npy_hash_t
300PyArray_DescrHash(PyObject* odescr)
301{
302 PyArray_Descr *descr;
303 int st;
304
305 if (!PyArray_DescrCheck(odescr)) {
306 PyErr_SetString(PyExc_ValueError,
307 "PyArray_DescrHash argument must be a type descriptor");
308 return -1;
309 }
310 descr = (PyArray_Descr*)odescr;
311
312 if (descr->hash == -1) {
313 st = _PyArray_DescrHashImp(descr, &descr->hash);
314 if (st) {
315 return -1;
316 }
317 }
318
319 return descr->hash;
320}

Callers

nothing calls this directly

Calls 1

_PyArray_DescrHashImpFunction · 0.85

Tested by

no test coverage detected