@@ -183,20 +183,37 @@ namespace cadabra {
183183 return dynamic_cast <const PropT*>(BoundPropertyBase::prop);
184184 }
185185
186-
186+ template <typename PropT, typename ... ParentTs>
187+ std::string BoundProperty<PropT, ParentTs...>::str_() const
188+ {
189+ return BoundPropertyBase::str_ ();
190+ }
191+
192+ template <typename PropT, typename ... ParentTs>
193+ std::string BoundProperty<PropT, ParentTs...>::latex_() const
194+ {
195+ return BoundPropertyBase::latex_ ();
196+ }
197+
198+ template <typename PropT, typename ... ParentTs>
199+ std::string BoundProperty<PropT, ParentTs...>::repr_() const
200+ {
201+ return BoundPropertyBase::str_ ();
202+ }
203+
187204 template <typename BoundPropT>
188205 typename BoundPropT::py_type def_abstract_prop (pybind11::module & m, const std::string& name)
189206 {
190207 using base_type = BoundPropT;
191- using cpp_type = typename base_type::cpp_type;
208+ // using cpp_type = typename base_type::cpp_type;
192209 using py_type = typename base_type::py_type;
193210
194211 return py_type (m, name.c_str (), py::multiple_inheritance ())
195212 .def_static (" get" , [](Ex_ptr ex, bool ipr) { return base_type::get_from_kernel (ex->begin (), ipr); }, py::arg (" ex" ), py::arg (" ignore_parent_rel" ) = false )
196213 .def_static (" get" , [](ExNode node, bool ipr) { return base_type::get_from_kernel (node.it , ipr); }, py::arg (" exnode" ), py::arg (" ignore_parent_rel" ) = false )
197- .def (" __str__" , &base_type ::str_)
198- .def (" __repr__" , &base_type ::repr_)
199- .def (" _latex_" , &base_type ::latex_);
214+ .def (" __str__" , &BoundPropT ::str_)
215+ .def (" __repr__" , &BoundPropT ::repr_)
216+ .def (" _latex_" , &BoundPropT ::latex_);
200217 }
201218
202219 template <typename BoundPropT>
@@ -210,9 +227,9 @@ namespace cadabra {
210227 .def (py::init<Ex_ptr, Ex_ptr>(), py::arg (" ex" ), py::arg (" param" ))
211228 .def_static (" get" , [](Ex_ptr ex, bool ipr) { return base_type::get_from_kernel (ex->begin (), ipr); }, py::arg (" ex" ), py::arg (" ignore_parent_rel" ) = false )
212229 .def_static (" get" , [](ExNode node, bool ipr) { return base_type::get_from_kernel (node.it , ipr); }, py::arg (" exnode" ), py::arg (" ignore_parent_rel" ) = false )
213- .def (" __str__" , &base_type ::str_)
214- .def (" __repr__" , &base_type ::repr_)
215- .def (" _latex_" , &base_type ::latex_);
230+ .def (" __str__" , &BoundPropT ::str_)
231+ .def (" __repr__" , &BoundPropT ::repr_)
232+ .def (" _latex_" , &BoundPropT ::latex_);
216233 }
217234
218235
0 commit comments