19 m.def(
"test_function2", [](
int,
int) {},
py::arg(
"a"),
py::arg(
"b"),
"A custom docstring");
21 m.def(
"test_overloaded1", [](
int) {},
py::arg(
"i"),
"Overload docstring");
22 m.def(
"test_overloaded1", [](
double) {},
py::arg(
"d"));
24 m.def(
"test_overloaded2", [](
int) {},
py::arg(
"i"),
"overload docstring 1");
25 m.def(
"test_overloaded2", [](
double) {},
py::arg(
"d"),
"overload docstring 2");
27 m.def(
"test_overloaded3", [](
int) {},
py::arg(
"i"));
28 m.def(
"test_overloaded3", [](
double) {},
py::arg(
"d"),
"Overload docstr");
33 m.def(
"test_function4", [](
int,
int) {},
py::arg(
"a"),
py::arg(
"b"),
"A custom docstring");
37 m.def(
"test_function5", [](
int,
int) {},
py::arg(
"a"),
py::arg(
"b"),
"A custom docstring");
41 nested_options.enable_user_defined_docstrings();
47 "A custom docstring");
51 m.def(
"test_function7", [](
int,
int) {},
py::arg(
"a"),
py::arg(
"b"),
"A custom docstring");
58 m.def(
"test_function8", []() {});
65 struct DocstringTestFoo {
67 void setValue(
int v) {
value =
v; }
68 int getValue()
const {
return value; }
70 py::class_<DocstringTestFoo>(
m,
"DocstringTestFoo",
"This is a class docstring")
71 .def_property(
"value_prop",
72 &DocstringTestFoo::getValue,
73 &DocstringTestFoo::setValue,
74 "This is a property docstring");
78 enum class DocstringTestEnum1 { Member1, Member2 };
80 py::enum_<DocstringTestEnum1>(
m,
"DocstringTestEnum1",
"Enum docstring")
81 .value(
"Member1", DocstringTestEnum1::Member1)
82 .value(
"Member2", DocstringTestEnum1::Member2);
89 enum class DocstringTestEnum2 { Member1, Member2 };
91 py::enum_<DocstringTestEnum2>(
m,
"DocstringTestEnum2",
"Enum docstring")
92 .value(
"Member1", DocstringTestEnum2::Member1)
93 .value(
"Member2", DocstringTestEnum2::Member2);
100 enum class DocstringTestEnum3 { Member1, Member2 };
102 py::enum_<DocstringTestEnum3>(
m,
"DocstringTestEnum3",
"Enum docstring")
103 .value(
"Member1", DocstringTestEnum3::Member1)
104 .value(
"Member2", DocstringTestEnum3::Member2);
111 enum class DocstringTestEnum4 { Member1, Member2 };
113 py::enum_<DocstringTestEnum4>(
m,
"DocstringTestEnum4",
"Enum docstring")
114 .value(
"Member1", DocstringTestEnum4::Member1)
115 .value(
"Member2", DocstringTestEnum4::Member2);
123 enum class DocstringTestEnum5 { Member1, Member2 };
125 py::enum_<DocstringTestEnum5>(
m,
"DocstringTestEnum5",
"Enum docstring")
126 .value(
"Member1", DocstringTestEnum5::Member1)
127 .value(
"Member2", DocstringTestEnum5::Member2);