]> SALOME platform Git repositories - tools/eficas.git/commitdiff
Salome HOME
modif len parametre
authoreficas <>
Tue, 28 Feb 2006 11:30:27 +0000 (11:30 +0000)
committereficas <>
Tue, 28 Feb 2006 11:30:27 +0000 (11:30 +0000)
Extensions/param2.py

index 831308e8fc79941d7c337f124809a1e197695ad4..5d307aace04e7d17d2f8f18184f422c6318ca7d1 100644 (file)
@@ -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())