[Python-Dev] Half-baked proposal: * (and **?) in assignments

Raymond Hettinger python@rcn.com
Sat, 23 Nov 2002 12:57:50 -0500


>     a,b,*c = 1,2,3,4,5

Hmm, a right-associative unary tuplizer that
is only valid for the right mostvariable in
the left-hand-side of a multiple-assignment.
It sure doesn't sound like a simplication.

Still, it looks like a handy tool for ML style 
head/tail separation:

head, *tail = func_returning_a_sequence()

And, it beats the existing alternative:

seq = func_returning_a_sequence()
head, tail = seq[0], seq[1:]


>     a,b,c,d,e = 1,2,*(3,4,5)

In this, the exisiting alternative is better:

a,b,(c,d,e) = 1,2,(3,4,5)



Raymond Hettinger