<br><br><div class="gmail_quote">On 15 December 2011 17:53, Steven D'Aprano <span dir="ltr"><<a href="mailto:steve@pearwood.info">steve@pearwood.info</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">Michael Foord wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 15 December 2011 17:35, Alexander Heger <<a href="mailto:python@2sn.net" target="_blank">python@2sn.net</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear Masklinn,<br>
<br>
thanks for your suggested solution.<br>
<br>
I know all of these, but<br>
1) it is not as elegant or short<br>
2) why does unpacking not work syntactically the same as for the function<br>
parameters?<br>
It seems a natural extension that appears not to have a syntactic<br>
conflict.  If it is not even a necessity for consistency.<br>
<br>
So, the point is not that something like<br>
[0,*x,0,*y,0]<br>
can't be done in other ways, but that it can't be done in a neat way.<br>
<br>
</blockquote>
<br>
<br>
I quite like that (suggested) syntax.<br>
</blockquote>
<br></div>
So do I. But I question the need for it.<br>
<br>
+0.<span class="HOEnZb"><font color="#888888"><br>
<br></font></span></blockquote><div><br>Well, the new tuple unpacking syntax makes it easy to work with the head and tail of a sequence:<br><br>    head, *rest = some_sequence<br>   *rest, tail = some_sequence<br><br>This syntax provides a corollary:<br>
<br>    some_sequence = (head, *rest)<br>    some_sequence = (*rest, tail)<br><br>Tuple unpacking like this being the equivalent of car and cdr, with the corollary being the equivalent of cons. (Given my limited understanding of these operations.)<br>
<br>Michael<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="HOEnZb"><font color="#888888">
<br>
-- <br>
Steven</font></span><div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/<u></u>mailman/listinfo/python-ideas</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><pre cols="72"><a href="http://www.voidspace.org.uk/" target="_blank">http://www.voidspace.org.uk/</a><br><br>May you do good and not evil<br>May you find forgiveness for yourself and forgive others<br>
May you share freely, never taking more than you give.<br>-- the sqlite blessing <a href="http://www.sqlite.org/different.html" target="_blank">http://www.sqlite.org/different.html</a></pre>
<br>