Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #17054 > unrolled thread

Re: Verbose and flexible args and kwargs syntax

Started byArnaud Delobelle <arnodel@gmail.com>
First post2011-12-12 16:10 +0000
Last post2011-12-12 16:10 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Verbose and flexible args and kwargs syntax Arnaud Delobelle <arnodel@gmail.com> - 2011-12-12 16:10 +0000

#17054 — Re: Verbose and flexible args and kwargs syntax

FromArnaud Delobelle <arnodel@gmail.com>
Date2011-12-12 16:10 +0000
SubjectRe: Verbose and flexible args and kwargs syntax
Message-ID<mailman.3552.1323706204.27778.python-list@python.org>
On 12 December 2011 15:52, Terry Reedy <tjreedy@udel.edu> wrote:

> No, *target unpacking (singular) is quite useful in specialized cases. But
> it is not specifically head/tail unpacking.
>
>>>> a,*b,c = 1,2,3,4,5,6
>>>> a,b,c
> (1, [2, 3, 4, 5], 6)
>>>> *a,b,c = 1,2,3,4,5
>>>> a,b,c
> ([1, 2, 3], 4, 5)
>
>> I personally quite like them, but I would like them to be more general.
>
>
> It already is. The *target can be anywhere in the sequence.
>
> --
> Terry Jan Reedy

You can even have nested sequences!

>>> a, (b, *c), *d = 1, "two", 3, 4

-- 
Arnaud

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web