| 1631 | } |
| 1632 | |
| 1633 | static PyObject * |
| 1634 | npyiter_index_get(NewNpyArrayIterObject *self, void *NPY_UNUSED(ignored)) |
| 1635 | { |
| 1636 | if (self->iter == NULL || self->finished) { |
| 1637 | PyErr_SetString(PyExc_ValueError, |
| 1638 | "Iterator is past the end"); |
| 1639 | return NULL; |
| 1640 | } |
| 1641 | |
| 1642 | if (NpyIter_HasIndex(self->iter)) { |
| 1643 | npy_intp ind = *NpyIter_GetIndexPtr(self->iter); |
| 1644 | return PyLong_FromLong(ind); |
| 1645 | } |
| 1646 | else { |
| 1647 | PyErr_SetString(PyExc_ValueError, |
| 1648 | "Iterator does not have an index"); |
| 1649 | return NULL; |
| 1650 | } |
| 1651 | } |
| 1652 | |
| 1653 | static int |
| 1654 | npyiter_index_set( |
nothing calls this directly
no test coverage detected