From 6a3a954a6b85d2f5dd770f7ab08d12bf1052a1b5 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Sun, 22 Oct 2023 07:53:00 -0700 Subject: [PATCH] Add missing `handle_type_name`. 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. --- include/pybind11/numpy.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h index 8551aa264..225d02571 100644 --- a/include/pybind11/numpy.h +++ b/include/pybind11/numpy.h @@ -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 { + static constexpr auto name = const_name("numpy.dtype"); +}; + template <> struct handle_type_name { static constexpr auto name = const_name("numpy.ndarray");