Prepackaged function args

John O'Hagan mail at johnohagan.com
Mon May 18 05:00:15 EDT 2009


On Mon, 18 May 2009, boblatest at googlemail.com wrote:
> Hello group,
>
> suppose I've got a function f() that takes N parameters, and a list
> (or tuple) arg[] with N elements that I'd like to pass as parameters.
> The straightforward function call looks like this:
>
> result = f(arg[0], arg[1], ..., arg[N-1])
>
> Is there a less verbose way of accomlishing this?
[...]

result = f(*arg)

Regards,

John




More information about the Python-list mailing list