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

Function _may_have_objects

numpy/core/src/multiarray/common.c:336–346  ·  view source on GitHub ↗

* check whether arrays with datatype dtype might have object fields. This will * only happen for structured dtypes (which may have hidden objects even if the * HASOBJECT flag is false), object dtypes, or subarray dtypes whose base type * is either of these. */

Source from the content-addressed store, hash-verified

334 * is either of these.
335 */
336NPY_NO_EXPORT int
337_may_have_objects(PyArray_Descr *dtype)
338{
339 PyArray_Descr *base = dtype;
340 if (PyDataType_HASSUBARRAY(dtype)) {
341 base = dtype->subarray->base;
342 }
343
344 return (PyDataType_HASFIELDS(base) ||
345 PyDataType_FLAGCHK(base, NPY_ITEM_HASOBJECT) );
346}
347
348/*
349 * Make a new empty array, of the passed size, of a type that takes the

Callers 2

array_descr_setFunction · 0.85
PyArray_GetFieldFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected