| 1704 | } |
| 1705 | |
| 1706 | static int |
| 1707 | npyiter_iterindex_set( |
| 1708 | NewNpyArrayIterObject *self, PyObject *value, void *NPY_UNUSED(ignored)) |
| 1709 | { |
| 1710 | npy_intp iterindex; |
| 1711 | |
| 1712 | if (value == NULL) { |
| 1713 | PyErr_SetString(PyExc_AttributeError, |
| 1714 | "Cannot delete nditer iterindex"); |
| 1715 | return -1; |
| 1716 | } |
| 1717 | if (self->iter == NULL) { |
| 1718 | PyErr_SetString(PyExc_ValueError, |
| 1719 | "Iterator is invalid"); |
| 1720 | return -1; |
| 1721 | } |
| 1722 | |
| 1723 | iterindex = PyLong_AsLong(value); |
| 1724 | if (error_converting(iterindex)) { |
| 1725 | return -1; |
| 1726 | } |
| 1727 | if (NpyIter_GotoIterIndex(self->iter, iterindex) != NPY_SUCCEED) { |
| 1728 | return -1; |
| 1729 | } |
| 1730 | self->started = 0; |
| 1731 | self->finished = 0; |
| 1732 | |
| 1733 | /* If there is nesting, the nested iterators should be reset */ |
| 1734 | if (npyiter_resetbasepointers(self) != NPY_SUCCEED) { |
| 1735 | return -1; |
| 1736 | } |
| 1737 | |
| 1738 | return 0; |
| 1739 | } |
| 1740 | |
| 1741 | static PyObject * |
| 1742 | npyiter_iterrange_get(NewNpyArrayIterObject *self, void *NPY_UNUSED(ignored)) |
nothing calls this directly
no test coverage detected