NUMPY_API * Generic new array creation routine. * * steals a reference to descr. On failure or when dtype->subarray is * true, dtype will be decrefed. */
| 977 | * true, dtype will be decrefed. |
| 978 | */ |
| 979 | NPY_NO_EXPORT PyObject * |
| 980 | PyArray_NewFromDescr( |
| 981 | PyTypeObject *subtype, PyArray_Descr *descr, |
| 982 | int nd, npy_intp const *dims, npy_intp const *strides, void *data, |
| 983 | int flags, PyObject *obj) |
| 984 | { |
| 985 | if (subtype == NULL) { |
| 986 | PyErr_SetString(PyExc_ValueError, |
| 987 | "subtype is NULL in PyArray_NewFromDescr"); |
| 988 | return NULL; |
| 989 | } |
| 990 | |
| 991 | if (descr == NULL) { |
| 992 | PyErr_SetString(PyExc_ValueError, |
| 993 | "descr is NULL in PyArray_NewFromDescr"); |
| 994 | return NULL; |
| 995 | } |
| 996 | |
| 997 | return PyArray_NewFromDescrAndBase( |
| 998 | subtype, descr, |
| 999 | nd, dims, strides, data, |
| 1000 | flags, obj, NULL); |
| 1001 | } |
| 1002 | |
| 1003 | /* |
| 1004 | * Sets the base object using PyArray_SetBaseObject |
no test coverage detected