Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_foo():
- def f(self, i):
- print(self,i)
- return f
- class A(object):
- def __init__(self, x):
- self.x = x
- def __str__(self):
- return str(self.x)
- def __repr__(self):
- return str(self.x)
- foo = get_foo();
- a = A(5)
- a.foo(4)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement