* Public version of `PyArrayMethod_FromSpec_int` (see below). * * TODO: Error paths will probably need to be improved before a release into * the non-experimental public API. */
| 391 | * the non-experimental public API. |
| 392 | */ |
| 393 | NPY_NO_EXPORT PyObject * |
| 394 | PyArrayMethod_FromSpec(PyArrayMethod_Spec *spec) |
| 395 | { |
| 396 | for (int i = 0; i < spec->nin + spec->nout; i++) { |
| 397 | if (!PyObject_TypeCheck(spec->dtypes[i], &PyArrayDTypeMeta_Type)) { |
| 398 | PyErr_SetString(PyExc_RuntimeError, |
| 399 | "ArrayMethod spec contained a non DType."); |
| 400 | return NULL; |
| 401 | } |
| 402 | } |
| 403 | return (PyObject *)PyArrayMethod_FromSpec_int(spec, 0); |
| 404 | } |
| 405 | |
| 406 | |
| 407 | /** |
no test coverage detected