| 1739 | } |
| 1740 | |
| 1741 | static PyObject * |
| 1742 | npyiter_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 | |
| 1766 | static int |
| 1767 | npyiter_iterrange_set( |
nothing calls this directly
no test coverage detected