[Python-ideas] iterable.__unpack__ method

Chris Angelico rosuav at gmail.com
Sun Feb 24 02:36:59 CET 2013


On Sun, Feb 24, 2013 at 11:53 AM, Terry Reedy <tjreedy at udel.edu> wrote:
> If ,* is not acceptible, how about ,** or ,... or ,None or <take your pick>.
> I rather like 'a, b, c, ... =' as it clearly implies that we are picking and
> naming the first three values from 3 or more; '...' clearly cannot be an
> assignment target.

I like that. It avoids the confusion with augmented assignment that ,*
has (yes, you can avoid the *syntactic* confusion by putting spaces
around the equals sign, but it's still visually similar). The only
problem might be in documentation, where it might be taken to mean "a,
b, c, d, e, and as many more variables as you want", eg indicating
that tuple unpacking works with any number of targets.

ChrisA



More information about the Python-ideas mailing list