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

Function arrayflags_aligned_set

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

Source from the content-addressed store, hash-verified

288}
289
290static int
291arrayflags_aligned_set(
292 PyArrayFlagsObject *self, PyObject *obj, void *NPY_UNUSED(ignored))
293{
294 PyObject *res;
295
296 if (obj == NULL) {
297 PyErr_SetString(PyExc_AttributeError,
298 "Cannot delete flags aligned attribute");
299 return -1;
300 }
301 if (self->arr == NULL) {
302 PyErr_SetString(PyExc_ValueError,
303 "Cannot set flags on array scalars.");
304 return -1;
305 }
306 res = PyObject_CallMethod(self->arr, "setflags", "OOO", Py_None,
307 (PyObject_IsTrue(obj) ? Py_True : Py_False),
308 Py_None);
309 if (res == NULL) {
310 return -1;
311 }
312 Py_DECREF(res);
313 return 0;
314}
315
316static int
317arrayflags_writeable_set(

Callers 1

arrayflags_setitemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected