Skip to content

Commit ac3b7c8

Browse files
cmastallijcarpent
authored andcommitted
[python] Extended copyable visitor
1 parent ab8c362 commit ac3b7c8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/eigenpy/copyable.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ struct CopyableVisitor : public bp::def_visitor<CopyableVisitor<C> > {
1818
template <class PyClass>
1919
void visit(PyClass& cl) const {
2020
cl.def("copy", &copy, bp::arg("self"), "Returns a copy of *this.");
21+
cl.def("__copy__", &copy,bp::arg("self"),"Returns a copy of *this.");
22+
cl.def("__deepcopy__", &deepcopy,bp::args("self","memo"),"Returns a deep copy of *this.");
2123
}
2224

2325
private:
2426
static C copy(const C& self) { return C(self); }
27+
static C deepcopy(const C & self, bp::dict) { return C(self); }
2528
};
2629
} // namespace eigenpy
2730

0 commit comments

Comments
 (0)