diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index 5384ecafb..be4f66b06 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -1606,6 +1606,7 @@ template struct is_holder_type struct handle_type_name { static constexpr auto name = _(); }; template <> struct handle_type_name { static constexpr auto name = _(PYBIND11_BYTES_NAME); }; +template <> struct handle_type_name { static constexpr auto name = _("int"); }; template <> struct handle_type_name { static constexpr auto name = _("Iterable"); }; template <> struct handle_type_name { static constexpr auto name = _("Iterator"); }; template <> struct handle_type_name { static constexpr auto name = _("*args"); }; diff --git a/tests/test_pytypes.cpp b/tests/test_pytypes.cpp index 244e1db0d..da9fcaea3 100644 --- a/tests/test_pytypes.cpp +++ b/tests/test_pytypes.cpp @@ -11,6 +11,8 @@ TEST_SUBMODULE(pytypes, m) { + // test_int + m.def("get_int", []{return py::int_(0);}); // test_list m.def("get_list", []() { py::list list; diff --git a/tests/test_pytypes.py b/tests/test_pytypes.py index 0e8d6c33a..89ec28583 100644 --- a/tests/test_pytypes.py +++ b/tests/test_pytypes.py @@ -5,6 +5,8 @@ import sys from pybind11_tests import pytypes as m from pybind11_tests import debug_enabled +def test_int(doc): + assert doc(m.get_int) == "get_int() -> int" def test_list(capture, doc): with capture: