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

Function arrayflags_writebackifcopy_set

numpy/core/src/multiarray/flagsobject.c:265–288  ·  view source on GitHub ↗

relies on setflags order being write, align, uic */

Source from the content-addressed store, hash-verified

263
264/* relies on setflags order being write, align, uic */
265static int
266arrayflags_writebackifcopy_set(
267 PyArrayFlagsObject *self, PyObject *obj, void *NPY_UNUSED(ignored))
268{
269 PyObject *res;
270
271 if (obj == NULL) {
272 PyErr_SetString(PyExc_AttributeError,
273 "Cannot delete flags writebackifcopy attribute");
274 return -1;
275 }
276 if (self->arr == NULL) {
277 PyErr_SetString(PyExc_ValueError,
278 "Cannot set flags on array scalars.");
279 return -1;
280 }
281 res = PyObject_CallMethod(self->arr, "setflags", "OOO", Py_None, Py_None,
282 (PyObject_IsTrue(obj) ? Py_True : Py_False));
283 if (res == NULL) {
284 return -1;
285 }
286 Py_DECREF(res);
287 return 0;
288}
289
290static int
291arrayflags_aligned_set(

Callers 1

arrayflags_setitemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected