Fixed bug in value() of wsum
@@ -426,8 +426,12 @@ class Operator(Expression):
def value(self):
# if self.name ==
+ if self.name == "wsum":
+ arg_vals = [self.args[0], [arg.value() if isinstance(arg, Expression) else arg for arg in self.args[1]]]
+ else:
arg_vals = [arg.value() if isinstance(arg, Expression) else arg for arg in self.args]
+
if any(a is None for a in arg_vals): return None
# non-boolean
elif self.name == "sum": return sum(arg_vals)
