3 ms·
Technically, you can open up Python classes: class Test(object): pass t = Test() def test(self): print('ehlo') Test.test = tes
by danjaouen 14y ago
Technically, you can open up Python classes:
class Test(object):
pass
t = Test()
def test(self):
print('ehlo')
Test.test = test
t.test()
This is rarely done in practice, however (at least, as far as I can tell)
- nobodysfool 14y agoIt's awesome, and that's how monkey-patching is done.