Passing on variable arguments

Kragen Sitaker kragen at pobox.com
Mon May 20 01:44:55 EDT 2002


"James T. Dennis" <jadestar at idiom.com> writes:
>  But it gets uglier if you want to use apply() with a prototype that 
>  matches A():
> 
> 	def D(x, *args):
> 	    args = list(args)
> 	    args.insert(0, x)
> 	    apply(A, args)

A slight simplification is apply(A, (x,) + args) --- yay functional
operators!




More information about the Python-list mailing list