Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class x(object):
- def __init__(self):
- self._func = None
- def __getattr__(self, name):
- self._func = lambda *a, **kw: lambda x: getattr(x, name)(*a, **kw)
- return self
- def __call__(self, *args, **kwargs):
- return self._func(*args, **kwargs)
- X = x()
- print " ".join(map(X.upper(), ["hello", "world"]))
- print " ".join(map(X.encode("hex"), ["hello", "world"]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement