MCPcopy Create free account
hub / github.com/numpy/numpy / npyiter_operands_get

Function npyiter_operands_get

numpy/core/src/multiarray/nditer_pywrap.c:1428–1456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1426}
1427
1428static PyObject *
1429npyiter_operands_get(NewNpyArrayIterObject *self, void *NPY_UNUSED(ignored))
1430{
1431 PyObject *ret;
1432
1433 npy_intp iop, nop;
1434 PyArrayObject **operands;
1435
1436 if (self->iter == NULL) {
1437 PyErr_SetString(PyExc_ValueError,
1438 "Iterator is invalid");
1439 return NULL;
1440 }
1441 nop = NpyIter_GetNOp(self->iter);
1442 operands = self->operands;
1443
1444 ret = PyTuple_New(nop);
1445 if (ret == NULL) {
1446 return NULL;
1447 }
1448 for (iop = 0; iop < nop; ++iop) {
1449 PyObject *operand = (PyObject *)operands[iop];
1450
1451 Py_INCREF(operand);
1452 PyTuple_SET_ITEM(ret, iop, operand);
1453 }
1454
1455 return ret;
1456}
1457
1458static PyObject *
1459npyiter_itviews_get(NewNpyArrayIterObject *self, void *NPY_UNUSED(ignored))

Callers

nothing calls this directly

Calls 1

NpyIter_GetNOpFunction · 0.85

Tested by

no test coverage detected