Remove cpp_name_needs_typing_annotated(). Preparation for bringing back commit 76b4a34aff.

This commit is contained in:
Ralf W. Grosse-Kunstleve 2023-10-21 11:09:09 -07:00
parent 90b3912b9f
commit bb8709a0d6
2 changed files with 1 additions and 15 deletions

View File

@ -493,11 +493,7 @@ protected:
} else { } else {
std::string tname(t->name()); std::string tname(t->name());
detail::clean_type_id(tname); detail::clean_type_id(tname);
if (detail::cpp_name_needs_typing_annotated(tname.c_str())) { signature += "Annotated[Any, CppTypePybind11(\"" + tname + "\")]";
signature += "Annotated[Any, CppTypePybind11(\"" + tname + "\")]";
} else {
signature += tname;
}
} }
} else { } else {
signature += c; signature += c;

View File

@ -113,15 +113,5 @@ struct handle_type_name<typing::Callable<Return(Args...)>> {
+ const_name("]"); + const_name("]");
}; };
inline bool cpp_name_needs_typing_annotated(const char *cpp_name) {
while (*cpp_name != '\0') {
char c = *cpp_name++;
if (c == ':' || c == '<') { // Assuming valid names, there is no need to check for '>'.
return true;
}
}
return false;
}
PYBIND11_NAMESPACE_END(detail) PYBIND11_NAMESPACE_END(detail)
PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE) PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)