Skip to content

Commit 08e9215

Browse files
committed
Fix python bindings for descriptions of maps and vectors
1 parent cebe6dc commit 08e9215

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

core/include/core/container_pybindings.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ register_g3vector(py::module_ &scope, std::string name, Args &&...args)
163163

164164
cls.def(g3frameobject_picklesuite<V>());
165165

166+
cls.def("__str__", &V::Summary)
167+
.def("Summary", &V::Summary, "Short (one-line) description of the object")
168+
.def("Description", &V::Description,
169+
"Long-form human-readable description of the object");
170+
166171
return cls;
167172
}
168173

@@ -390,6 +395,11 @@ register_g3map(py::module_ &scope, std::string name, Args &&...args)
390395

391396
cls.def(g3frameobject_picklesuite<M>());
392397

398+
cls.def("__str__", &M::Summary)
399+
.def("Summary", &M::Summary, "Short (one-line) description of the object")
400+
.def("Description", &M::Description,
401+
"Long-form human-readable description of the object");
402+
393403
return cls;
394404
}
395405

0 commit comments

Comments
 (0)