Commit 4f1531c4 by Sergei Izmailov Committed by Wenzel Jakob

Render `py::int_` as `int` in docstrings

parent 90d99b56
......@@ -1606,6 +1606,7 @@ template <typename base, typename deleter> struct is_holder_type<base, std::uniq
template <typename T> struct handle_type_name { static constexpr auto name = _<T>(); };
template <> struct handle_type_name<bytes> { static constexpr auto name = _(PYBIND11_BYTES_NAME); };
template <> struct handle_type_name<int_> { static constexpr auto name = _("int"); };
template <> struct handle_type_name<iterable> { static constexpr auto name = _("Iterable"); };
template <> struct handle_type_name<iterator> { static constexpr auto name = _("Iterator"); };
template <> struct handle_type_name<args> { static constexpr auto name = _("*args"); };
......
......@@ -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;
......
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment