But is that really so much better than <div><br></div><div>  command = next(iterargs)</div><div>  # etc.</div><div><br></div><div>?</div><div><br></div><div>And to me the ... Looks too much like something that consumes the rest, rather than leaving it.</div>
<div><br></div><div>--Guido (not on a real keyboard)<span></span><br><br>On Saturday, February 23, 2013, Nick Coghlan  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Sun, Feb 24, 2013 at 12:12 PM, Nick Coghlan <<a href="javascript:;" onclick="_e(event, 'cvml', 'ncoghlan@gmail.com')">ncoghlan@gmail.com</a>> wrote:<br>
> I definitely like Terry's idea of using ", ..." to say "and ignore the<br>
> rest". Simple, elegant and can be restricted to the last element so it works<br>
> with infinite iterators and large sequences. It also allows incremental<br>
> unpacking of ordinary iterators.<br>
<br>
I want to expand on this a bit now I'm back on a real computer, since<br>
it wasn't immediately obvious to me how well the ", ..." proposal<br>
supports incremental unpacking, but it became clear once I thought of<br>
this simple example:<br>
<br>
    iterargs = iter(args)<br>
    command, ... = iterargs # Grab the first element, leave the rest<br>
in the iterator<br>
    commands[command](*iterargs) # Pass the rest to the command<br>
<br>
Cheers,<br>
Nick.<br>
<br>
--<br>
Nick Coghlan   |   <a href="javascript:;" onclick="_e(event, 'cvml', 'ncoghlan@gmail.com')">ncoghlan@gmail.com</a>   |   Brisbane, Australia<br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'Python-ideas@python.org')">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
</blockquote></div><br><br>-- <br>--Guido van Rossum (<a href="http://python.org/~guido">python.org/~guido</a>)<br>