| 1347 | } |
| 1348 | |
| 1349 | static PyObject * |
| 1350 | npyiter_enable_external_loop( |
| 1351 | NewNpyArrayIterObject *self, PyObject *NPY_UNUSED(args)) |
| 1352 | { |
| 1353 | if (self->iter == NULL) { |
| 1354 | PyErr_SetString(PyExc_ValueError, |
| 1355 | "Iterator is invalid"); |
| 1356 | return NULL; |
| 1357 | } |
| 1358 | |
| 1359 | NpyIter_EnableExternalLoop(self->iter); |
| 1360 | /* EnableExternalLoop invalidates cached values */ |
| 1361 | npyiter_cache_values(self); |
| 1362 | /* EnableExternalLoop also resets the iterator */ |
| 1363 | if (NpyIter_GetIterSize(self->iter) == 0) { |
| 1364 | self->started = 1; |
| 1365 | self->finished = 1; |
| 1366 | } |
| 1367 | else { |
| 1368 | self->started = 0; |
| 1369 | self->finished = 0; |
| 1370 | } |
| 1371 | |
| 1372 | Py_RETURN_NONE; |
| 1373 | } |
| 1374 | |
| 1375 | static PyObject * |
| 1376 | npyiter_debug_print(NewNpyArrayIterObject *self, PyObject *NPY_UNUSED(args)) |
nothing calls this directly
no test coverage detected