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

Function npyiter_iterrange_get

numpy/core/src/multiarray/nditer_pywrap.c:1741–1764  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1739}
1740
1741static PyObject *
1742npyiter_iterrange_get(NewNpyArrayIterObject *self, void *NPY_UNUSED(ignored))
1743{
1744 npy_intp istart = 0, iend = 0;
1745 PyObject *ret;
1746
1747 if (self->iter == NULL) {
1748 PyErr_SetString(PyExc_ValueError,
1749 "Iterator is invalid");
1750 return NULL;
1751 }
1752
1753 NpyIter_GetIterIndexRange(self->iter, &istart, &iend);
1754
1755 ret = PyTuple_New(2);
1756 if (ret == NULL) {
1757 return NULL;
1758 }
1759
1760 PyTuple_SET_ITEM(ret, 0, PyLong_FromLong(istart));
1761 PyTuple_SET_ITEM(ret, 1, PyLong_FromLong(iend));
1762
1763 return ret;
1764}
1765
1766static int
1767npyiter_iterrange_set(

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected