tags:

views:

58

answers:

2

Is there an equivilant in Python for PHPs call_user_func_array?

+5  A: 

Call the function with the array preceded by *:

function(*array)
Jaime Soriano
This is the right answer.
Christopher W. Allen-Poole
+2  A: 

if your function name is a string, you could do:

getattr(obj, 'func')(*arr)     # where obj is the namespace that hold func
SilentGhost
This is exactly what i ment.
DerKlops