From 05fa8bf580e45b49623206191b59c3be13b99ff3 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Mon, 25 Nov 2013 18:58:27 +0000 Subject: [PATCH] make data_append() coping with any iterable data type (not just list) --- lib/damask/asciitable.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/damask/asciitable.py b/lib/damask/asciitable.py index 05e6d8a59..f74f0f163 100644 --- a/lib/damask/asciitable.py +++ b/lib/damask/asciitable.py @@ -210,9 +210,10 @@ class ASCIItable(): # ------------------------------------------------------------------ def data_append(self, what): - if isinstance(what,list): + try: for item in what: self.data_append(item) - else: self.data += [str(what)] + except TypeError: + self.data += [str(what)] # ------------------------------------------------------------------ def data_set(self,