<div dir="ltr">I'm actually not in favor of this. It's another way to do the same thing. Sorry to rain on your dream!<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 6, 2017 at 9:34 AM, R. David Murray <span dir="ltr"><<a href="mailto:rdmurray@bitdance.com" target="_blank">rdmurray@bitdance.com</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 Wed, 06 Sep 2017 15:05:51 +1000, Chris Angelico <<a href="mailto:rosuav@gmail.com">rosuav@gmail.com</a>> wrote:<br>
> On Wed, Sep 6, 2017 at 10:11 AM, R. David Murray <<a href="mailto:rdmurray@bitdance.com">rdmurray@bitdance.com</a>> wrote:<br>
> > I've written a PEP proposing a small enhancement to the Python loop<br>
> > control statements.  Short version: here's what feels to me like a<br>
> > Pythonic way to spell "repeat until":<br>
> ><br>
> >     while:<br>
> >         <do stuff><br>
> >         break if <done condition><br>
> ><br>
> > The PEP goes into some detail on why this feels like a readability<br>
> > improvement in the more general case, with examples taken from<br>
> > the standard library:<br>
> ><br>
> >      <a href="https://www.python.org/dev/peps/pep-0548/" rel="noreferrer" target="_blank">https://www.python.org/dev/<wbr>peps/pep-0548/</a><br>
><br>
> Is "break if" legal in loops that have their own conditions as well,<br>
> or only in a bare "while:" loop? For instance, is this valid?<br>
><br>
> while not found_the_thing_we_want:<br>
>     data = sock.read()<br>
>     break if not data<br>
>     process(data)<br>
<br>
</span>Yes.<br>
<span class=""><br>
> Or this, which uses the condition purely as a descriptor:<br>
><br>
> while "moar socket data":<br>
>     data = sock.read()<br>
>     break if not data<br>
>     process(data)<br>
<br>
</span>Yes.<br>
<span class=""><br>
> Also - shouldn't this be being discussed first on python-ideas?<br>
<br>
</span>Yep, you are absolutely right.  Someone has told me I also missed<br>
a related discussion on python-ideas in my searching for prior<br>
discussions.  (I haven't looked for it yet...)<br>
<br>
I'll blame jet lag :)<br>
<span class="HOEnZb"><font color="#888888"><br>
--David<br>
</font></span><div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/guido%40python.org" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/options/python-dev/<wbr>guido%40python.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div>