mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
Add const T to docstring generation. (#3020)
* Add const T to docstring generation. * Change order. * See if existing test triggers for a const type. * Add tests. * Fix test. * Remove experiment. * Reformat. * More tests, checks run. * Adding `test_fmt_desc_` prefix to new test functions. * Using pytest.mark.parametrize to 1. condense test; 2. exercise all functions even if one fails; 3. be less platform-specific (e.g. C++ float is not necessarily float32). Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
This commit is contained in:
@@ -437,4 +437,10 @@ TEST_SUBMODULE(numpy_array, sm) {
|
||||
sm.def("accept_double_f_style_forcecast_noconvert",
|
||||
[](py::array_t<double, py::array::forcecast | py::array::f_style>) {},
|
||||
"a"_a.noconvert());
|
||||
|
||||
// Check that types returns correct npy format descriptor
|
||||
sm.def("test_fmt_desc_float", [](py::array_t<float>) {});
|
||||
sm.def("test_fmt_desc_double", [](py::array_t<double>) {});
|
||||
sm.def("test_fmt_desc_const_float", [](py::array_t<const float>) {});
|
||||
sm.def("test_fmt_desc_const_double", [](py::array_t<const double>) {});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user