Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. import types
  2.  
  3. class A(object):
  4.         def method_of_a(self):
  5.                 print 'method of a'
  6.  
  7. class B(object):
  8.         pass
  9.  
  10. B.method_of_b = A.__dict__['method_of_a'].__get__(None, B)
  11.  
  12. b = B()
  13. b.method_of_b()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement