From 272152e68b062749e892dbb362ced079064fd666 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 20 Oct 2023 22:10:54 -0700 Subject: [PATCH] `Annotated[Any, CppTypePybind11("cpp_namespace::UserType")]` based on a suggestion by @sizmailov https://github.com/pybind/pybind11/pull/4888#issuecomment-1773618327 --- include/pybind11/pybind11.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index 35f5c13ba..d51a0c6fb 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -494,7 +494,7 @@ protected: std::string tname(t->name()); detail::clean_type_id(tname); if (detail::cpp_name_needs_typing_annotated(tname.c_str())) { - signature += "Annotated[Any, \"" + tname + "\"]"; + signature += "Annotated[Any, CppTypePybind11(\"" + tname + "\")]"; } else { signature += tname; }