def perform(fun, *args): fun(*args) def action1(args): # something def action2(args): # something perform(action1) perform(action2, p) perform(action3, p, r)