Verbose and flexible args and kwargs syntax
Arnaud Delobelle
arnodel at gmail.com
Mon Dec 12 11:10:00 EST 2011
More information about the Python-list mailing list
Mon Dec 12 11:10:00 EST 2011
- Previous message (by thread): Verbose and flexible args and kwargs syntax
- Next message (by thread): Verbose and flexible args and kwargs syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 12 December 2011 15:52, Terry Reedy <tjreedy at 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
- Previous message (by thread): Verbose and flexible args and kwargs syntax
- Next message (by thread): Verbose and flexible args and kwargs syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list