unwrapping argument tuples
nospam at no.spam
Thu Dec 14 01:52:23 CET 2000
On 13 Dec 2000, Prashanth Mundkur wrote:
> is there a way to unwrap a tuple argument to a function and
> match it to the parameters?
> that is, if
> >>>lst = [1, 2, 3]
> >>>def func (p1,p2,p3):
> return p1+p2+p3
> then I want to apply func somewhat as
> such that the elements of lst are unwrapped and and matched to p1, p2,
> tx for any tips.
Well, just try:
>>> apply(func, lst)
Carsten Geckeler: carsten dot geckeler at gmx dot de
To get proper email-address replace `dot' and `at' by the corresponding symbols.
More information about the Python-list