unwrapping argument tuples

Prashanth Mundkur prashanth.mundkur at kla-tencor.com
Wed Dec 13 15:13:31 EST 2000


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

>>>func(lst)
6

such that the elements of lst are unwrapped and and matched to p1, p2,
p3

tx for any tips.

--prashanth



-- 
Posted from [206.67.220.38] 
via Mailgate.ORG Server - http://www.Mailgate.ORG



More information about the Python-list mailing list