NUMPY_API * steals a reference to descr -- accepts NULL */
| 1760 | * steals a reference to descr -- accepts NULL |
| 1761 | */ |
| 1762 | NPY_NO_EXPORT PyObject * |
| 1763 | PyArray_CheckFromAny(PyObject *op, PyArray_Descr *descr, int min_depth, |
| 1764 | int max_depth, int requires, PyObject *context) |
| 1765 | { |
| 1766 | npy_dtype_info dt_info = {NULL, NULL}; |
| 1767 | |
| 1768 | int res = PyArray_ExtractDTypeAndDescriptor( |
| 1769 | descr, &dt_info.descr, &dt_info.dtype); |
| 1770 | |
| 1771 | Py_XDECREF(descr); |
| 1772 | |
| 1773 | if (res < 0) { |
| 1774 | Py_XDECREF(dt_info.descr); |
| 1775 | Py_XDECREF(dt_info.dtype); |
| 1776 | return NULL; |
| 1777 | } |
| 1778 | |
| 1779 | PyObject* ret = PyArray_CheckFromAny_int( |
| 1780 | op, dt_info.descr, dt_info.dtype, min_depth, max_depth, requires, |
| 1781 | context); |
| 1782 | |
| 1783 | Py_XDECREF(dt_info.descr); |
| 1784 | Py_XDECREF(dt_info.dtype); |
| 1785 | return ret; |
| 1786 | } |
| 1787 | |
| 1788 | /* |
| 1789 | * Internal version of PyArray_CheckFromAny that accepts a dtypemeta. Borrows |
no test coverage detected