Is there a way to loop through and execute all of the functions in a Python class?
- by curious
I have
class Foo():
function bar():
pass
function foobar():
pass
Rather than executing each function one by one as follows:
x = Foo()
x.bar()
x.foobar()
is there a built-in way to loop through and execute each function in the sequence in which they are written in the class? It doesn't matter whether the solution is to add code to the class Foo(), or to do something to x.