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

Function _is_tuple_of_integers

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

Source from the content-addressed store, hash-verified

754}
755
756static int
757_is_tuple_of_integers(PyObject *obj)
758{
759 int i;
760
761 if (!PyTuple_Check(obj)) {
762 return 0;
763 }
764 for (i = 0; i < PyTuple_GET_SIZE(obj); i++) {
765 if (!PyArray_IsIntegerScalar(PyTuple_GET_ITEM(obj, i))) {
766 return 0;
767 }
768 }
769 return 1;
770}
771
772/*
773 * helper function for _try_convert_from_inherit_tuple to disallow dtypes of the form

Callers 2

arraydescr_setstateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected