Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- print(sys.version)
- class Foo:
- def test(self):
- return 1
- class Bar:
- def test(self):
- return 2
- foo = Foo()
- foo.__class__ = Bar
- print(foo.test())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement