<div dir="ltr"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">> Care to repeat those arguments?</span><div><br></div><div>Indeed.<div><br></div><div>*Minimal use of characters*</div><div><br></div><div>The primary benefit for me would be the minimal use of characters, which within list comprehensions I think is not an insignificant benefit:<div><pre style="text-align:start;text-indent:0px;text-decoration-style:initial;text-decoration-color:initial"><font color="#000000"><span style="white-space:pre-wrap">    stuff = [[(f(x) as y), x/y] for x in range(5)]      # seems quite syntactically busy</span></font><pre style="color:rgb(0,0,0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-transform:none;white-space:pre-wrap;word-spacing:0px;text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">    stuff = [[y := f(x), x/y] for x in range(5)]        # better</pre><pre style="color:rgb(0,0,0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-transform:none;white-space:pre-wrap;word-spacing:0px;text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">    stuff = [[y! f(x), x/y] for x in range(5)]          # two fewer characters (if you include the space after the identifier)</pre><pre style="color:rgb(0,0,0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-transform:none;white-space:pre-wrap;word-spacing:0px;text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><font face="arial, helvetica, sans-serif">*Thoughts on odd usage of "!"*</font></pre><pre style="color:rgb(0,0,0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-transform:none;white-space:pre-wrap;word-spacing:0px;text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><font face="arial, helvetica, sans-serif">In the English language, `!` signifies an exclamation, and I am imagining a similar usage to that of introducing something by its name in an energetic way. For example a boxer walking in to the ring:</font><br></pre><pre style="color:rgb(0,0,0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-transform:none;white-space:pre-wrap;word-spacing:0px;text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">"Muhammed_Ali! <in walks Muhammed Ali>", "x! get_x()"</pre><pre style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><font face="arial, helvetica, sans-serif"><font color="#000000"><span style="white-space:pre-wrap"><pre style="color:rgb(34,34,34);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><pre style="color:rgb(0,0,0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-transform:none;white-space:pre-wrap;word-spacing:0px;text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><font face="arial, helvetica, sans-serif">I get that `!` is associated with "not", and factorial, but I couldn't think of another character already used that would work in this usage. </font><font color="#000000" style="font-family:arial,helvetica,sans-serif">I also think `name! expression` would be hard to interpret as a comparison or factorial. I suppose the trade off here is efficiency vs. idiosyncrasy. </font><span style="font-family:arial,helvetica,sans-serif;color:rgb(34,34,34)">I very much appreciate this is all very tentative, but I wanted to explain why this syntax does not sit terribly with me.</span></pre></pre></span></font></font></pre><pre style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><font face="arial, helvetica, sans-serif">Cammil</font></pre></pre><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 7 April 2018 at 00:49, Steven D'Aprano <span dir="ltr"><<a href="mailto:steve@pearwood.info" target="_blank">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"><span class="">On Fri, Apr 06, 2018 at 03:27:45PM +0000, Cammil Taank wrote:<br>
> I'm not sure if my suggestion for 572 has been considered:<br>
><br>
> ``name! expression``<br>
><br>
> I'm curious what the pros and cons of this form would be (?).<br>
<br>
</span>I can't see any pros for it. In what way is ! associated with assignment<br>
or binding? It might as well be a arbitrary symbol.<br>
<br>
(Yes, I know that ultimately *everything* is an arbitrary symbol, but<br>
some of them have very strong associations built on years or decades or<br>
centuries of usage.)<br>
<br>
As Peter says, ! is associated with negation, as in !=, and to those of<br>
us with a maths background, name! simply *screams* "FACTORIAL" at the<br>
top of its voice.<br>
<span class=""><br>
<br>
> My arguments for were in a previous message but there do not seem to be any<br>
> responses to it.<br>
<br>
</span>Care to repeat those arguments?<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
Steve<br>
</font></span><div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br>
</div></div></blockquote></div><br></div>