Example #1
0
 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)
Example #2
0
 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)