test_docstring_options.cpp (11986:c12e4625ab56) | test_docstring_options.cpp (12037:d28054ac6ec9) |
---|---|
1/* 2 tests/test_docstring_options.cpp -- generation of docstrings and signatures 3 4 Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch> 5 6 All rights reserved. Use of this source code is governed by a 7 BSD-style license that can be found in the LICENSE file. 8*/ --- 10 unchanged lines hidden (view full) --- 19 20 { 21 py::options options; 22 options.disable_function_signatures(); 23 24 m.def("test_function1", [](int, int) {}, py::arg("a"), py::arg("b")); 25 m.def("test_function2", [](int, int) {}, py::arg("a"), py::arg("b"), "A custom docstring"); 26 | 1/* 2 tests/test_docstring_options.cpp -- generation of docstrings and signatures 3 4 Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch> 5 6 All rights reserved. Use of this source code is governed by a 7 BSD-style license that can be found in the LICENSE file. 8*/ --- 10 unchanged lines hidden (view full) --- 19 20 { 21 py::options options; 22 options.disable_function_signatures(); 23 24 m.def("test_function1", [](int, int) {}, py::arg("a"), py::arg("b")); 25 m.def("test_function2", [](int, int) {}, py::arg("a"), py::arg("b"), "A custom docstring"); 26 |
27 m.def("test_overloaded1", [](int) {}, py::arg("i"), "Overload docstring"); 28 m.def("test_overloaded1", [](double) {}, py::arg("d")); 29 30 m.def("test_overloaded2", [](int) {}, py::arg("i"), "overload docstring 1"); 31 m.def("test_overloaded2", [](double) {}, py::arg("d"), "overload docstring 2"); 32 33 m.def("test_overloaded3", [](int) {}, py::arg("i")); 34 m.def("test_overloaded3", [](double) {}, py::arg("d"), "Overload docstr"); 35 |
|
27 options.enable_function_signatures(); 28 29 m.def("test_function3", [](int, int) {}, py::arg("a"), py::arg("b")); 30 m.def("test_function4", [](int, int) {}, py::arg("a"), py::arg("b"), "A custom docstring"); 31 32 options.disable_function_signatures().disable_user_defined_docstrings(); 33 34 m.def("test_function5", [](int, int) {}, py::arg("a"), py::arg("b"), "A custom docstring"); --- 19 unchanged lines hidden --- | 36 options.enable_function_signatures(); 37 38 m.def("test_function3", [](int, int) {}, py::arg("a"), py::arg("b")); 39 m.def("test_function4", [](int, int) {}, py::arg("a"), py::arg("b"), "A custom docstring"); 40 41 options.disable_function_signatures().disable_user_defined_docstrings(); 42 43 m.def("test_function5", [](int, int) {}, py::arg("a"), py::arg("b"), "A custom docstring"); --- 19 unchanged lines hidden --- |