This is essentially the same as calling numpy.dtype(args) in Python.
| 871 | |
| 872 | /// This is essentially the same as calling numpy.dtype(args) in Python. |
| 873 | static dtype from_args(const object &args) { |
| 874 | PyObject *ptr = nullptr; |
| 875 | if ((detail::npy_api::get().PyArray_DescrConverter_(args.ptr(), &ptr) == 0) || !ptr) { |
| 876 | throw error_already_set(); |
| 877 | } |
| 878 | return reinterpret_steal<dtype>(ptr); |
| 879 | } |
| 880 | |
| 881 | /// Return dtype associated with a C++ type. |
| 882 | template <typename T> |