Good practice of using list of function in Python
- by riskio
I am pretty new to python and I discovered by myself that I can create a list of function and call with a for loop.
example:
def a(args):
print "A"
def b(args):
print "B"
def c(args):
print "C " + str(args)
functions = [a,b,c]
for i in functions:
i(1)
So, my question is: is there any good practice or elegant way to use list of functions and what is a good use of all this? (do have a particular name the "list of functions"?)
thank you