[Python-ideas] iterable.__unpack__ method

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Feb 26 00:30:03 CET 2013


Devin Jeanpierre wrote:
> On Mon, Feb 25, 2013 at 7:45 AM, Jan Kaliszewski <zuo at chopin.edu.pl> wrote:
>>    a, b, *() = iterable
> 
> Of course, you can't unpack anything into (), because Python never had
> that syntax, but you get the idea.

-1, this is just as arbitrary as ... or a lone *.

I prefer ... myself, because visually it has a low profile
and doesn't draw undue attention to something that you're
saying you don't care about.

Maybe ... could be blessed as an official "don't care"
assignment target, like _ in Haskell. That would make this
usage less of a special case (although it would still be
partially special, since it suppresses unpacking of the
rest of the iterator).

-- 
Greg



More information about the Python-ideas mailing list