From 563ec494066b50e278e2400081f8b31d964acbba Mon Sep 17 00:00:00 2001 From: eficas <> Date: Tue, 28 Feb 2006 11:30:27 +0000 Subject: [PATCH] modif len parametre --- Extensions/param2.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Extensions/param2.py b/Extensions/param2.py index 831308e8..5d307aac 100644 --- a/Extensions/param2.py +++ b/Extensions/param2.py @@ -15,7 +15,13 @@ def mkf(value): #class Formula(object): class Formula: - def __len__(self): return len(self.eval()) + def __len__(self): + val=self.eval() + if val is None:return 0 + try: + return len(val) + except: + return 1 def __complex__(self): return complex(self.eval()) def __int__(self): return int(self.eval()) def __long__(self): return long(self.eval()) -- 2.39.2