| 1456 | } |
| 1457 | |
| 1458 | static PyObject * |
| 1459 | npyiter_itviews_get(NewNpyArrayIterObject *self, void *NPY_UNUSED(ignored)) |
| 1460 | { |
| 1461 | PyObject *ret; |
| 1462 | |
| 1463 | npy_intp iop, nop; |
| 1464 | |
| 1465 | if (self->iter == NULL) { |
| 1466 | PyErr_SetString(PyExc_ValueError, |
| 1467 | "Iterator is invalid"); |
| 1468 | return NULL; |
| 1469 | } |
| 1470 | nop = NpyIter_GetNOp(self->iter); |
| 1471 | |
| 1472 | ret = PyTuple_New(nop); |
| 1473 | if (ret == NULL) { |
| 1474 | return NULL; |
| 1475 | } |
| 1476 | for (iop = 0; iop < nop; ++iop) { |
| 1477 | PyArrayObject *view = NpyIter_GetIterView(self->iter, iop); |
| 1478 | |
| 1479 | if (view == NULL) { |
| 1480 | Py_DECREF(ret); |
| 1481 | return NULL; |
| 1482 | } |
| 1483 | PyTuple_SET_ITEM(ret, iop, (PyObject *)view); |
| 1484 | } |
| 1485 | |
| 1486 | return ret; |
| 1487 | } |
| 1488 | |
| 1489 | static PyObject * |
| 1490 | npyiter_next(NewNpyArrayIterObject *self) |
nothing calls this directly
no test coverage detected