<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 21 May 2018 at 12:05, Rhodri James <span dir="ltr"><<a href="mailto:rhodri@kynesim.co.uk" target="_blank">rhodri@kynesim.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="gmail-"><br></span>
Thanks for the analysis, but I'm afraid I must disagree with your recommendation.  It was the thought I first had when Chris came out with his first draft of the PEP several months ago, but it's not enough to cope with my usual use cases.  What I normally want is the Python equivalent of:<br>
<br>
  while ((v = get_something()) != INCONVENIENT_SENTINEL)<br>
    do_something(v);<br>
<br>
The condition expression itself is not what I want to capture; I need a subexpression, which the "as" syntax won't give me.<span class="gmail-im gmail-HOEnZb"><br>
<br></span></blockquote><div><br></div><div>That use case should be covered by</div><div><br></div><div>for v in iter(get_something, INCOVENIENT_SENTINEL):</div><div>    do_something(v)</div><div><br></div><div><br></div></div><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"></div><div dir="ltr"><table border="0" cellpadding="0" cellspacing="0" style="font-family:"Times New Roman""><tbody><tr valign="top"><td width="10%" style="display:block;width:60px;margin-right:30px"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td height="150" style="display:block;width:120px;height:50px;margin-top:10px;margin-bottom:30px;margin-left:15px"><a href="https://www.machinalis.co.uk" style="color:rgb(111,111,111);font-size:12px" target="_blank"><img src="http://machinalis.com/images/machinalis.png" style="height:auto" alt=""></a></td></tr></tbody></table></td><td width="90%"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td valign="top" style="padding:0px 0px 0px 20px"><table border="0" cellspacing="0" cellpadding="0"><tbody><tr style="font-family:poppins;font-size:14px;font-weight:bold;color:rgb(51,51,51)"><td>Daniel Moisset</td></tr><tr style="font-family:poppins;font-size:12px;text-transform:uppercase;letter-spacing:1px;color:rgb(205,39,66);padding:20px 0px 5px"><td>UK COUNTRY MANAGER</td></tr><tr><td style="padding:6px 0px"><table width="50px" height="1px" border="0" cellspacing="0" cellpadding="0" style="width:300px"><tbody><tr><td bgcolor="#e8e8e8" height="1px" style="font-size:1px;line-height:1px"> </td></tr></tbody></table></td></tr><tr><td style="font-family:poppins"><table border="0" cellspacing="0" cellpadding="0"><tbody><tr><td valign="top"><a href="https://goo.gl/maps/pH9BBLgE8dG2" style="color:rgb(111,111,111);font-size:12px" target="_blank"><span>A:   1 Fore Street, EC2Y 9DT London</span></a></td></tr></tbody></table></td></tr><tr><td style="font-family:poppins"><table border="0" cellspacing="0" cellpadding="0"><tbody><tr><td valign="top"><a href="tel:+44+7398+827139" style="color:rgb(111,111,111);font-size:12px" target="_blank">P:   +44 7398 827139</a><span style="color:rgb(111,111,111);font-size:12px"></span> <a style="color:rgb(111,111,111);font-size:12px"></a> </td></tr></tbody></table></td></tr><tr><td style="font-family:poppins"><table border="0" cellspacing="0" cellpadding="0"><tbody><tr><td valign="top"><a href="mailto:dmoisset@machinalis.com" style="color:rgb(111,111,111);font-size:12px" target="_blank">M:   dmoisset@machinalis.com</a><span style="color:rgb(111,111,111);font-size:12px">  |  </span> <a style="color:rgb(111,111,111);font-size:12px">S:   dmoisset</a>  </td></tr><tr><td style="padding:10px 0px 0px"><a href="http://www.linkedin.com/company/456525" style="color:rgb(111,111,111);font-size:12px" target="_blank"><img src="https://machinalis.com/images/red_linkedin.png" style="height:auto"></a> <a href="http://www.twitter.com/machinalis" style="color:rgb(111,111,111);font-size:12px;padding-left:10px" target="_blank"><img src="https://machinalis.com/images/red_twitter.png" style="height:auto"></a> <a href="http://www.facebook.com/machinalis" style="color:rgb(111,111,111);font-size:12px;padding-left:10px" target="_blank"><img src="https://machinalis.com/images/red_face.png" style="height:auto"></a> <a href="https://www.instagram.com/machinalis.life/" style="color:rgb(111,111,111);font-size:12px;padding-left:10px" target="_blank"><img src="https://machinalis.com/images/red_insta.png" style="height:auto"></a></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table><span><table width="100%" border="0" cellpadding="0" cellspacing="0" style="font-family:"Times New Roman""><tbody><tr><td><table bgcolor="#ffffff" align="left" cellpadding="0" cellspacing="0" border="0"><tbody></tbody></table></td></tr></tbody></table></span><span style="font-family:Arial;font-size:10.6667px;white-space:pre-wrap">Machinalis Limited is a company registered in England and Wales. Registered number: 10574987.</span></div></div></div></div></div></div></div></div>
</div></div>