diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 4ced21baaaa..52cf7357394 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -93,7 +93,7 @@ The valid options are: * `-DPYBIND11_NOPYTHON=ON`: Disable all Python searching (disables tests) * `-DBUILD_TESTING=ON`: Enable the tests * `-DDOWNLOAD_CATCH=ON`: Download catch to build the C++ tests -* `-DOWNLOAD_EIGEN=ON`: Download Eigen for the NumPy tests +* `-DDOWNLOAD_EIGEN=ON`: Download Eigen for the NumPy tests * `-DPYBIND11_INSTALL=ON/OFF`: Enable the install target (on by default for the master project) * `-DUSE_PYTHON_INSTALL_DIR=ON`: Try to install into the python dir diff --git a/docs/advanced/misc.rst b/docs/advanced/misc.rst index ab692bc7c12..47df9ddc53b 100644 --- a/docs/advanced/misc.rst +++ b/docs/advanced/misc.rst @@ -317,7 +317,7 @@ For example: >>> help(example.add) add(...) - | add(arg0: int, arg1: int) -> int + | add(arg0: int, arg1: int) -> int\ | add(arg0: float, arg1: float) -> float | Overloaded function. | @@ -355,8 +355,8 @@ The above example would produce the following docstring: >>> help(example.add) add(...) - | add(arg0: int, arg1: int) -> int - | add(arg0: float, arg1: float) -> float + | add(arg0: int, arg1: int) -> int\ + | add(arg0: float, arg1: float) -> float\ | add(arg0: None, arg1: None) -> None | A function which adds two numbers. | diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index f394c10bd4b..747c99c8e76 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -411,6 +411,7 @@ class cpp_function : public function { for (auto it = chain_start; it != nullptr; it = it->next) { signatures += rec->name; signatures += it->signature; + if (it->next != nullptr) signatures += "\\"; signatures += "\n"; } if (options::show_section_headings()) { diff --git a/tests/test_factory_constructors.py b/tests/test_factory_constructors.py index aee47c1fb49..2faa7edb757 100644 --- a/tests/test_factory_constructors.py +++ b/tests/test_factory_constructors.py @@ -88,9 +88,9 @@ def test_init_factory_signature(msg): assert ( msg(m.TestFactory1.__init__.__doc__) == """ - __init__(self: m.factory_constructors.TestFactory1, arg0: m.factory_constructors.tag.unique_ptr_tag, arg1: int) -> None - __init__(self: m.factory_constructors.TestFactory1, arg0: str) -> None - __init__(self: m.factory_constructors.TestFactory1, arg0: m.factory_constructors.tag.pointer_tag) -> None + __init__(self: m.factory_constructors.TestFactory1, arg0: m.factory_constructors.tag.unique_ptr_tag, arg1: int) -> None\\ + __init__(self: m.factory_constructors.TestFactory1, arg0: str) -> None\\ + __init__(self: m.factory_constructors.TestFactory1, arg0: m.factory_constructors.tag.pointer_tag) -> None\\ __init__(self: m.factory_constructors.TestFactory1, arg0: handle, arg1: int, arg2: handle) -> None Overloaded function. @@ -107,8 +107,8 @@ def test_init_factory_signature(msg): assert ( msg(m.TestFactory2.__init__.__doc__) == """ - __init__(self: m.factory_constructors.TestFactory2, arg0: m.factory_constructors.tag.pointer_tag, arg1: int) -> None - __init__(self: m.factory_constructors.TestFactory2, arg0: m.factory_constructors.tag.unique_ptr_tag, arg1: str) -> None + __init__(self: m.factory_constructors.TestFactory2, arg0: m.factory_constructors.tag.pointer_tag, arg1: int) -> None\\ + __init__(self: m.factory_constructors.TestFactory2, arg0: m.factory_constructors.tag.unique_ptr_tag, arg1: str) -> None\\ __init__(self: m.factory_constructors.TestFactory2, arg0: m.factory_constructors.tag.move_tag) -> None This is one part of the docstring. This is the other part of the docstring.