as I was wondering how tuple unpacking was working, I've found on several threads this answer as an alternative to slicing :
>>>>def unpack(first,*rest):
return first, rest
which works as follows:
>>>>first,rest=unpack(*(1,2,3))
>>>>first
1
>>>>rest
(2,3)
I don't understand how the * works. The argument "first" isn't supposed to be given to my function unpack ? I thought * meant that the argument was optional.
Thanks for your help