class A(object):

    def test(self):
        print('orig')
first_a = A()
first_a.test()

def decorated_test(fn):

    def new_test(*args, **kwargs):
        fn(*args, **kwargs)
print('new')
return new_test
A.test = decorated_test(A.test)
new_a = A()
new_a.test()
first_a.test()
Python add to a function dynamically