Add missing handle_type_name<dtype>.

Discovered via manual inspection by @sizmailov:

https://github.com/pybind/pybind11/pull/4888#issuecomment-1774023960

NOTE: This is actually a bug fix, in its own right.
This commit is contained in:
Ralf W. Grosse-Kunstleve 2023-10-22 07:53:00 -07:00
parent 74817b7f9f
commit 6a3a954a6b

View File

@ -41,10 +41,16 @@ PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
PYBIND11_WARNING_DISABLE_MSVC(4127)
class dtype; // Forward declaration
class array; // Forward declaration
PYBIND11_NAMESPACE_BEGIN(detail)
template <>
struct handle_type_name<dtype> {
static constexpr auto name = const_name("numpy.dtype");
};
template <>
struct handle_type_name<array> {
static constexpr auto name = const_name("numpy.ndarray");