From 199532e98977a456cc86579e905b22c23e16d4c3 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Sat, 21 Oct 2023 11:09:39 -0700 Subject: [PATCH] Reapply "Add `struct handle_type_name<...>` specializations for `object`, `list`, etc." This reverts commit 794d97e54e22bebb4657f47a52affa5ed76da469. --- include/pybind11/cast.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index 8b5beb0ef..9da63772e 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -876,6 +876,38 @@ struct handle_type_name { static constexpr auto name = const_name(); }; template <> +struct handle_type_name { + static constexpr auto name = const_name("object"); +}; +template <> +struct handle_type_name { + static constexpr auto name = const_name("list"); +}; +template <> +struct handle_type_name { + static constexpr auto name = const_name("dict"); +}; +template <> +struct handle_type_name { + static constexpr auto name = const_name("set"); +}; +template <> +struct handle_type_name { + static constexpr auto name = const_name("frozenset"); +}; +template <> +struct handle_type_name { + static constexpr auto name = const_name("anyset"); +}; +template <> +struct handle_type_name { + static constexpr auto name = const_name("str"); +}; +template <> +struct handle_type_name { + static constexpr auto name = const_name("tuple"); +}; +template <> struct handle_type_name { static constexpr auto name = const_name("bool"); };