We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2cbf77a commit ef433dcCopy full SHA for ef433dc
tests/test_pickling.cpp
@@ -37,13 +37,13 @@ void wrap(py::module m) {
37
.def(py::init<>())
38
.def_readwrite("num", &SimpleBase::num)
39
.def(py::pickle(
40
- [](py::object self) {
+ [](const py::object& self) {
41
py::dict d;
42
if (py::hasattr(self, "__dict__"))
43
d = self.attr("__dict__");
44
return py::make_tuple(self.attr("num"), d);
45
},
46
- [](py::tuple t) {
+ [](const py::tuple& t) {
47
if (t.size() != 2)
48
throw std::runtime_error("Invalid state!");
49
auto cpp_state = std::unique_ptr<SimpleBase>(new SimpleBaseTrampoline);
0 commit comments