MCPcopy Create free account
hub / github.com/pybind/pybind11 / from_args

Method from_args

include/pybind11/numpy.h:873–879  ·  view source on GitHub ↗

This is essentially the same as calling numpy.dtype(args) in Python.

Source from the content-addressed store, hash-verified

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>

Callers

nothing calls this directly

Calls 2

getFunction · 0.85
ptrMethod · 0.80

Tested by

no test coverage detected