Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. import sys
  2. print(sys.version)
  3.  
  4. class Foo:
  5. def test(self):
  6. return 1
  7.  
  8. class Bar:
  9. def test(self):
  10. return 2
  11.  
  12.  
  13. foo = Foo()
  14. foo.__class__ = Bar
  15. print(foo.test())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement