<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;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"><div class="gmail_quote" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;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">2018-05-12 11:36 GMT+03:00 Angus Hollands<span> </span><span dir="ltr"><<a href="mailto:goosey15@gmail.com" target="_blank" style="color:rgb(17,85,204)">goosey15@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Concerning my previous email,<br><br>Yes, my mistake. I'd forgotten (ironically) that the whole point is that it's an expression itself.<br><br>So<br>> while (value:=get_next_pool_item()).<wbr>in_use:<br>> print(value.refcount())<br>would be the appropriate analogue.<br><br>Consequently, my example is invalid. A better example would have been where one needs to access more than one attribute of the expression<div><br></div><div>while (node.x, node.y) > (5.0, 5.0) given node = get_neighbours(node):<br> pass</div></div></blockquote></div><br class="gmail-Apple-interchange-newline">
<br></div><div class="gmail_quote">In addition, this form gives you all the advantages of tuple unpacking:</div><div class="gmail_quote"><br></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_quote"><font face="monospace, monospace"><span style="color:rgb(34,34,34);font-size:small;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">while (x, y) > (5.0, 5.0) given x, y = get_neighbours(node):</span></font></div></div><div class="gmail_extra"><div class="gmail_quote"><font face="monospace, monospace"><span style="color:rgb(34,34,34);font-size:small;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"> pass</span>
</font></div><div class="gmail_quote"><font face="monospace, monospace"><span style="color:rgb(34,34,34);font-size:small;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"><br></span></font></div></div></blockquote><font face="arial, helvetica, sans-serif">There was some criticism about the length of the `given`, maybe it is possible to _repurpose_ `with` keyword:<br></font><div><font face="arial, helvetica, sans-serif"><br></font></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><font face="arial, helvetica, sans-serif"><div class="gmail_extra"><div class="gmail_quote"><font face="monospace, monospace"><span style="color:rgb(34,34,34);font-size:small;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">while (x, y) > (5.0, 5.0) with x, y = get_neighbours(node):</span></font></div></div></font></div><div><font face="arial, helvetica, sans-serif"><div class="gmail_extra"><div class="gmail_quote" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;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"><font face="monospace, monospace"><span style="color:rgb(34,34,34);font-size:small;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"> pass</span></font></div></div></font></div></blockquote><div><font face="arial, helvetica, sans-serif">
<div class="gmail_extra"><br class="gmail-Apple-interchange-newline">
</div><div class="gmail_extra">In this context, the with statement and with expression are clearly distinguishable both for the parser and for the person. But maybe many will find this as a bad style ... since the semantics are too different.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">With kind regards,</div><div class="gmail_extra">-gdg</div><br></font></div></div>