python str method for arrays

This commit is contained in:
Christopher Lackner 2020-04-06 12:43:42 +02:00
parent a52ccd7ce5
commit d74061dd23

View File

@ -142,6 +142,10 @@ namespace ngcore
return py::make_iterator (self.begin(),self.end()); return py::make_iterator (self.begin(),self.end());
}, py::keep_alive<0,1>()) // keep array alive while iterator is used }, py::keep_alive<0,1>()) // keep array alive while iterator is used
.def("__str__", [](TFlat& self)
{
return ToString(self);
})
; ;
if constexpr (detail::HasPyFormat<T>::value) if constexpr (detail::HasPyFormat<T>::value)