Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class lolmyclass:
- def __init__(self):
- self.something = None
- class heya:
- def __init__(self):
- self.lol = 5
- def set_some(self, an_obj):
- setattr(an_obj, 'somefunc', self.some_func)
- def some_func(self):
- print(self.lol)
- mylol = lolmyclass()
- myheya = heya()
- myheya.set_some(mylol)
- mylol.somefunc()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement