From 3c209443552e0be509592f2bab6f6221353e2e5d Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Sun, 22 Oct 2023 07:57:11 -0700 Subject: [PATCH] Add missing `handle_type_name<>` specializations for `bytearray`, `memoryview`, `type`. Discovered via manual inspection by @sizmailov: https://github.com/pybind/pybind11/pull/4888#issuecomment-1774023960 --- include/pybind11/cast.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index e5bc4f266..cdeb4aa8b 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -952,10 +952,22 @@ struct handle_type_name { static constexpr auto name = const_name("Sequence"); }; template <> +struct handle_type_name { + static constexpr auto name = const_name("bytearray"); +}; +template <> +struct handle_type_name { + static constexpr auto name = const_name("memoryview"); +}; +template <> struct handle_type_name { static constexpr auto name = const_name("slice"); }; template <> +struct handle_type_name { + static constexpr auto name = const_name("type"); +}; +template <> struct handle_type_name { static constexpr auto name = const_name("*args"); };