File tree Expand file tree Collapse file tree 4 files changed +41
-3
lines changed
py-demo/bindings/src/modules
pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings
pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings Expand file tree Collapse file tree 4 files changed +41
-3
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,10 @@ def print_class_body(self, class_: Class) -> list[str]:
122122 def print_docstring (self , doc : Docstring ) -> list [str ]:
123123 return [
124124 '"""' ,
125- * (line .replace ('"""' , r"\"\"\"" ) for line in doc .splitlines ()),
125+ * (
126+ line .replace ("\\ " , r"\\" ).replace ('"""' , r"\"\"\"" )
127+ for line in doc .splitlines ()
128+ ),
126129 '"""' ,
127130 ]
128131
Original file line number Diff line number Diff line change @@ -22,6 +22,15 @@ void bind_issues_module(py::module &&m) {
2222 " Tuning parameter (0 rad⁻¹ < zeta < 1 rad⁻¹) for which larger\n "
2323 " values provide more damping in response." ));
2424 }
25+ {
26+ m.def (" backslashes_should_be_escaped" , [] {}, R"docstring(
27+ \brief A brief description of this function.
28+
29+ A detailed description of this function.
30+
31+ Here's some reStructuredText: :math:`x = [x, y, \theta]^T`
32+ )docstring" );
33+ }
2534 {
2635 // https://github.com/sizmailov/pybind11-stubgen/issues/86
2736 auto cleanup_callback = []() { /* ... */ };
Original file line number Diff line number Diff line change @@ -2,7 +2,20 @@ from __future__ import annotations
22
33import typing
44
5- __all__ = ["issue_51_catastrophic_regex" , "issue_73_utf8_doc_chars" ]
5+ __all__ = [
6+ "backslashes_should_be_escaped" ,
7+ "issue_51_catastrophic_regex" ,
8+ "issue_73_utf8_doc_chars" ,
9+ ]
10+
11+ def backslashes_should_be_escaped () -> None :
12+ """
13+ \\ brief A brief description of this function.
14+
15+ A detailed description of this function.
16+
17+ Here's some reStructuredText: :math:`x = [x, y, \\ theta]^T`
18+ """
619
720def issue_51_catastrophic_regex (arg0 : int , arg1 : int ) -> None :
821 """
Original file line number Diff line number Diff line change @@ -2,7 +2,20 @@ from __future__ import annotations
22
33import typing
44
5- __all__ = ["issue_51_catastrophic_regex" , "issue_73_utf8_doc_chars" ]
5+ __all__ = [
6+ "backslashes_should_be_escaped" ,
7+ "issue_51_catastrophic_regex" ,
8+ "issue_73_utf8_doc_chars" ,
9+ ]
10+
11+ def backslashes_should_be_escaped () -> None :
12+ """
13+ \\ brief A brief description of this function.
14+
15+ A detailed description of this function.
16+
17+ Here's some reStructuredText: :math:`x = [x, y, \\ theta]^T`
18+ """
619
720def issue_51_catastrophic_regex (arg0 : int , arg1 : int ) -> None :
821 """
You can’t perform that action at this time.
0 commit comments