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

Function array_setfield

numpy/core/src/multiarray/methods.c:502–522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

500}
501
502static PyObject *
503array_setfield(PyArrayObject *self, PyObject *args, PyObject *kwds)
504{
505 PyArray_Descr *dtype = NULL;
506 int offset = 0;
507 PyObject *value;
508 static char *kwlist[] = {"value", "dtype", "offset", 0};
509
510 if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO&|i:setfield", kwlist,
511 &value,
512 PyArray_DescrConverter, &dtype,
513 &offset)) {
514 Py_XDECREF(dtype);
515 return NULL;
516 }
517
518 if (PyArray_SetField(self, dtype, offset, value) < 0) {
519 return NULL;
520 }
521 Py_RETURN_NONE;
522}
523
524/* This doesn't change the descriptor just the actual data...
525 */

Callers

nothing calls this directly

Calls 1

PyArray_SetFieldFunction · 0.85

Tested by

no test coverage detected