variable function call

Anthony Baxter anthony at interlink.com.au
Thu Nov 8 21:16:02 EST 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