From d74061dd2352e07f805a2912a0ee3544aaea494b Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Mon, 6 Apr 2020 12:43:42 +0200 Subject: [PATCH] python str method for arrays --- libsrc/core/python_ngcore.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libsrc/core/python_ngcore.hpp b/libsrc/core/python_ngcore.hpp index 44bf0362..92cbbe62 100644 --- a/libsrc/core/python_ngcore.hpp +++ b/libsrc/core/python_ngcore.hpp @@ -142,6 +142,10 @@ namespace ngcore return py::make_iterator (self.begin(),self.end()); }, py::keep_alive<0,1>()) // keep array alive while iterator is used + .def("__str__", [](TFlat& self) + { + return ToString(self); + }) ; if constexpr (detail::HasPyFormat::value)