stuff function objects into data structures : Function Object « Function « Python Tutorial






def echo(message):                  
    print message 


schedule = [ (echo, 'Spam!'), (echo, 'Ham!') ]
for (func, arg) in schedule:
    func(arg)








10.9.Function Object
10.9.1.Functions Are Objects: Indirect Calls
10.9.2.stuff function objects into data structures