<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 12/05/2018 23:52, Neil Girdhar
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAA68w_mTunqx5807V97KZOzMf-Psd6eoG+EwKECAbOAXrs8fDw@mail.gmail.com">
<div dir="ltr"><br>
<br>
<div class="gmail_quote">
<div dir="ltr">On Sat, May 12, 2018 at 5:54 PM Cameron Simpson
<<a href="mailto:cs@cskk.id.au" moz-do-not-send="true">cs@cskk.id.au</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">On
06May2018 02:00, Nick Coghlan <<a
href="mailto:ncoghlan@gmail.com" target="_blank"
moz-do-not-send="true">ncoghlan@gmail.com</a>> wrote:<br>
>On 5 May 2018 at 13:36, Tim Peters <<a
href="mailto:tim.peters@gmail.com" target="_blank"
moz-do-not-send="true">tim.peters@gmail.com</a>> wrote:<br>
>> If only one trailing "given" clause can be given
per `if` test<br>
>> expression, presumably I couldn't do that without
trickery.<br>
><br>
>I was actually thinking that if we did want to allow
multiple assignments,<br>
>and we limited targets to single names, we could just
use a comma as a<br>
>separator:<br>
><br>
> if diff and g > 1 given diff = x - x_base, g =
gcd(diff, n):<br>
> return g<br>
><br>
>Similar to import statements, optional parentheses could
be included in the<br>
>grammar, allowing the name bindings to be split across
multiple lines:<br>
><br>
> if diff and g > 1 given (<br>
> diff = x - x_base,<br>
> g = gcd(diff, n),<br>
> ):<br>
> return g<br>
<br>
I'm well behind, but... this! This turns "given" into a +0.8
for me.<br>
<br>
That's really nice. It reads clearly too.<br>
<br>
I was hitherto in the "expression as name" camp, which I
gather is already <br>
rejected.<br>
</blockquote>
<div><br>
</div>
<div>I love given, but that's the one thing I don't like. I
prefer this:</div>
<div> if (diff and g > 1 <br>
given diff = x - x_base<br>
given g = gcd(diff, n)):<br>
return g<br>
</div>
<div><br>
</div>
</div>
</div>
</blockquote>
I don't like the consecutive "given"s. Reading it aloud in English
suggests to me that the second "given" should be evaluated before
the first, which I'm sure is not the intention.<br>
(Just as I think that multiple for-loops inside a comprehension
sound the wrong way round. <span class="moz-smiley-s2"><span>:-(</span></span>
But that ship has sailed.)<br>
Rob Cliffe<br>
<blockquote type="cite"
cite="mid:CAA68w_mTunqx5807V97KZOzMf-Psd6eoG+EwKECAbOAXrs8fDw@mail.gmail.com">
<div dir="ltr">
<div class="gmail_quote">
<div>—just like for and if subexpressions. Doing this can
also open up weirdness if someone tries to roll something
like:</div>
<div><br>
</div>
<div>a = f(), # Make a tuple of length 1</div>
<div><br>
</div>
<div>into a given statement. Now, where do you up the
parentheses?</div>
<div><br>
</div>
<div>given (</div>
<div> a = (f(),),</div>
<div> b = whatever?</div>
<div>)</div>
<div><br>
</div>
<div>Seems weird.</div>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers,<br>
Cameron Simpson <<a href="mailto:cs@cskk.id.au"
target="_blank" moz-do-not-send="true">cs@cskk.id.au</a>><br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank"
moz-do-not-send="true">Python-ideas@python.org</a><br>
<a
href="https://mail.python.org/mailman/listinfo/python-ideas"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a
href="http://python.org/psf/codeofconduct/"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://python.org/psf/codeofconduct/</a><br>
<br>
-- <br>
<br>
--- <br>
You received this message because you are subscribed to a
topic in the Google Groups "python-ideas" group.<br>
To unsubscribe from this topic, visit <a
href="https://groups.google.com/d/topic/python-ideas/CFuqwmE8s-E/unsubscribe"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://groups.google.com/d/topic/python-ideas/CFuqwmE8s-E/unsubscribe</a>.<br>
To unsubscribe from this group and all its topics, send an
email to <a
href="mailto:python-ideas%2Bunsubscribe@googlegroups.com"
target="_blank" moz-do-not-send="true">python-ideas+unsubscribe@googlegroups.com</a>.<br>
For more options, visit <a
href="https://groups.google.com/d/optout" rel="noreferrer"
target="_blank" moz-do-not-send="true">https://groups.google.com/d/optout</a>.<br>
</blockquote>
</div>
</div>
<div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br>
<table style="border-top: 1px solid #D3D4DE;">
<tbody>
<tr>
<td style="width: 55px; padding-top: 13px;"><a
href="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient"
target="_blank" moz-do-not-send="true"><img
src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-green-avg-v1.png"
alt="" style="width: 46px; height: 29px;"
moz-do-not-send="true" height="29" width="46"></a></td>
<td style="width: 470px; padding-top: 12px; color:
#41424e; font-size: 13px; font-family: Arial, Helvetica,
sans-serif; line-height: 18px;">Virus-free. <a
href="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient"
target="_blank" style="color: #4453ea;"
moz-do-not-send="true">www.avg.com</a> </td>
</tr>
</tbody>
</table>
<a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1"
height="1" moz-do-not-send="true"> </a></div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Python-ideas mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Python-ideas@python.org">Python-ideas@python.org</a>
<a class="moz-txt-link-freetext" href="https://mail.python.org/mailman/listinfo/python-ideas">https://mail.python.org/mailman/listinfo/python-ideas</a>
Code of Conduct: <a class="moz-txt-link-freetext" href="http://python.org/psf/codeofconduct/">http://python.org/psf/codeofconduct/</a>
</pre>
</blockquote>
<br>
</body>
</html>