Pythonification of the asterisk-based collection packing/unpacking syntax

Joshua Landau joshua.landau.ws at gmail.com
Wed Dec 21 11:55:58 EST 2011


On 21 December 2011 15:48, Neal Becker <ndbecker2 at gmail.com> wrote:

> Clarification: where can packing/unpacking syntax be used?
>
> It would be great if it were valid essentially anywhere (not limited to
> parameter passing).
>
> What about constructs like:
>
> a, @tuple tail, b = sequence?


>>> a, *b, c = range(10)
>>> a, b, c
(0, [1, 2, 3, 4, 5, 6, 7, 8], 9)

It's just a proposed syntax change, effectively, so yes. However,
http://bugs.python.org/issue2292 covers the ones we don't have (that we
should :P). This discussion doesn't cover that.


> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20111221/f7ab2222/attachment-0001.html>


More information about the Python-list mailing list