From cc0d798302ef0854757d8db05220acdfdbc37567 Mon Sep 17 00:00:00 2001 From: Yann Weber Date: Sun, 13 May 2018 22:51:30 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20d'une=20m=C3=A9thode=20str=20pour=20les?= =?UTF-8?q?=20RpnExpr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gte/rpnlib.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gte/rpnlib.py b/gte/rpnlib.py index 9c1c27f..a9fd0d3 100644 --- a/gte/rpnlib.py +++ b/gte/rpnlib.py @@ -60,6 +60,9 @@ class RpnExpr(list): raise TypeError('RpnSymbol expected but got %s' % type(val)) super().__setitem(idx, val) + def __str__(self): + return ' '.join([str(sym) for sym in self]) + @classmethod def random(cls, sz): return cls([RpnSymbol.random() for _ in range(sz)])