Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import types
- class A(object):
- def method_of_a(self):
- print 'method of a'
- class B(object):
- pass
- B.method_of_b = A.__dict__['method_of_a'].__get__(None, B)
- b = B()
- b.method_of_b()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement