[Python-ideas] Unpack of sequences

Ethan Furman ethan at stoneleaf.us
Thu Aug 30 00:31:12 CEST 2012


Mike Graham wrote:
> On Wed, Aug 29, 2012 at 11:03 AM, Guido van Rossum <guido at python.org> wrote:
>> Also of course assignment has no equivalent to keyword parameters, nor
>> does it (currently) allow a "lone star" -- although it would be handy
>> to be able to say
>>
>> a, b, * = xs
>>
>> as a shorthand for
>>
>> a, b, *_ = xs
>> del _
> 
> Is there any good reason not to introduce this syntax?

I'm guessing because

a, b = xs[:2]

is not difficult.

Mind you, I'm not opposed to the idea.

~Ethan~



More information about the Python-ideas mailing list