chore: Change numpy dtype from_args call sig to const ref (#3878)

* Change numpy from_args call signature to avoid copy

* Reorder ctors

* Rename arg

* Fix unnecessary move

* Fix clang-tidy and Add a few missing moves to memory_view pytype
This commit is contained in:
Aaron Gokaslan
2022-04-18 11:11:24 -04:00
committed by GitHub
parent fbcde3f0af
commit 1c636f4dce
3 changed files with 11 additions and 8 deletions

View File

@@ -610,5 +610,5 @@ TEST_SUBMODULE(numpy_dtypes, m) {
[]() { PYBIND11_NUMPY_DTYPE(SimpleStruct, bool_, uint_, float_, ldbl_); });
// test_str_leak
m.def("dtype_wrapper", [](py::object d) { return py::dtype::from_args(std::move(d)); });
m.def("dtype_wrapper", [](const py::object &d) { return py::dtype::from_args(d); });
}