mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-11 08:03:55 +00:00
Render py::int_
as int
in docstrings
This commit is contained in:
parent
90d99b56a0
commit
4f1531c454
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user