variable function call

Anthony Baxter anthony at interlink.com.au
Fri Nov 9 03:16:02 CET 2001


>>> Uwe Schmitt wrote
>     def wrapper(fun, *args):
> 	... do some checks ...
> 	fun(args)
> 	... do some update of states ...
> 
> But if I use the function
>    def sum(a,b): return a+b
> and do
>    wrapper(sum,1,2)

Change
     fun(args)
to 
     apply(fun, args)

Anthony




More information about the Python-list mailing list