do_magic() # Throws exception, doesn\'t execute do_foo and do_bar do_foo() do_bar()
try: do_mag
If all three functions accept same number of parameters:
for f in (do_magic, do_foo, do_bar): try: f() except: pass
Otherwise, wrap the function call with lambda.
lambda
for f in (do_magic, lambda: do_foo(arg1, arg2)): try: f() except: pass