From: Vladimír Vondruš Date: Wed, 5 Jan 2022 21:26:44 +0000 (+0100) Subject: documentation/python: add a test with full pybind11 docstrings. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=63baae238730bb81b6ab4b9cd8580ade4fe01e95;p=blog.git documentation/python: add a test with full pybind11 docstrings. Those get currently ignored. --- diff --git a/documentation/test_python/pybind_signatures/pybind_signatures.cpp b/documentation/test_python/pybind_signatures/pybind_signatures.cpp index a982f2b1..e6934b3f 100644 --- a/documentation/test_python/pybind_signatures/pybind_signatures.cpp +++ b/documentation/test_python/pybind_signatures/pybind_signatures.cpp @@ -75,7 +75,11 @@ PYBIND11_MODULE(pybind_signatures, m) { .def("tenOverloads", &tenOverloads, "Ten overloads of a function") .def("tenOverloads", &tenOverloads, "Ten overloads of a function") .def("tenOverloads", &tenOverloads, "Ten overloads of a function") - .def("tenOverloads", &tenOverloads, "Ten overloads of a function"); + .def("tenOverloads", &tenOverloads, "Ten overloads of a function") + + .def("full_docstring", &voidFunction, R"(A summary + +And a larger docstring as well, which is currently ignored.)"); py::class_(m, "MyClass", "My fun class!") .def_static("static_function", &MyClass::staticFunction, "Static method with positional-only args") diff --git a/documentation/test_python/pybind_signatures/pybind_signatures.html b/documentation/test_python/pybind_signatures/pybind_signatures.html index f844969e..19c79b1b 100644 --- a/documentation/test_python/pybind_signatures/pybind_signatures.html +++ b/documentation/test_python/pybind_signatures/pybind_signatures.html @@ -63,6 +63,10 @@ def failed_parse_docstring(…)
A failed parse should <strong>also</strong> escape the docstring
+
+ def full_docstring(arg0: int, /) -> None +
+
A summary
def overloaded(arg0: int, /) -> str