| 500 | } |
| 501 | |
| 502 | static PyObject * |
| 503 | array_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 | */ |
nothing calls this directly
no test coverage detected