[Python-ideas] iterable.__unpack__ method

João Bernardo jbvsmo at gmail.com
Mon Feb 25 17:29:07 CET 2013


> But maybe it could be extended to include the following variant:
>
>     a, b, *() = iterable
>
>
Python already supports this odd syntax

    a, b, *[] = iterable

because it interprets the [] not as an empty list, but as an empty "list of
identifiers". Maybe it could be used for something useful.

BTW, the del syntax has the same "problem"

    del a, b, (c,), [d], []
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130225/4e7a890a/attachment.html>


More information about the Python-ideas mailing list