From 74817b7f9f384cd5fd15d5765d3c6594adac2e0a Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Sun, 22 Oct 2023 07:32:12 -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/pybind11.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index f3bccd824..8ae27a8a1 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -1318,6 +1318,15 @@ public: } }; +PYBIND11_NAMESPACE_BEGIN(detail) + +template <> +struct handle_type_name { + static constexpr auto name = const_name("module"); +}; + +PYBIND11_NAMESPACE_END(detail) + // When inside a namespace (or anywhere as long as it's not the first item on a line), // C++20 allows "module" to be used. This is provided for backward compatibility, and for // simplicity, if someone wants to use py::module for example, that is perfectly safe.