[Python-ideas] iterable.__unpack__ method
Terry Reedy
tjreedy at udel.edu
Mon Feb 25 01:57:51 CET 2013
On 2/24/2013 1:24 AM, Guido van Rossum wrote:
> But is that really so much better than
>
> command = next(iterargs)
> # etc.
>
> ?
>
> And to me the ... Looks too much like something that consumes the rest,
> rather than leaving it.
I considered $ for $top, but I was sure you would not want to waste $ in
this. In my original suggestion, I also suggested None as in
a, b, c, None = source
as another possibly to signal
"I want source iteration to stop even if there are more items, and I
don't want an exception raised even if there are, because I think I know
what I am doing and I do not want it to be considered a bug."
Any other short spelling/signal would be fine, too.
--
Terry Jan Reedy
More information about the Python-ideas
mailing list