I am aware there was a post related to this question. But that post was not what I have in mind. So I am wondering if there is only one way to approach it? Or there exists multiple ways.
I am not sure if the title of this post makes sense. But I encountered a problem that I wanted to create many decorator functions with the build-in method. What is meant is as follows:
@some_decorator_fcn
def function_1(data):
return data.method_1()
@some_decorator_fcn
def function_2(data):
return data.method_2()
@some_decorator_fcn
def function_3(data):
return data.method_3()
......
......
So basically, I need as many methods as possible. I know we can use dir(data) to find all relevant methods, but is there a way to automate this process without explicitly writing all of the methods out? Thank you.