def __call__(self, *args, **kwds): """ Call method such that self(foo, ...) is transformed into foo.self(...). Note that self(foo=...,...) is not transformed, it is treated as a normal symbolic substitution. """ if len(args) == 0: return Expression.__call__(self, **kwds) return args[0].__getattribute__(str(self))(*args[1:], **kwds)