def __call__(self, *args): while type(args[0]) is list: args = args[0] assert len(args) == 1 x = args[0] if isinstance(x, expr): return expr(self, [x]) return math.fabs(x)
def __call__(self, *args): while type(args[0]) is list: args = args[0] assert len(args) == 1 x = args[0] if isinstance(x, expr): return expr(self, [x]) if x > 0.0: return x return 0.0