On Wed, Sep 26, 2018 at 12:35 PM Michael Selik <m...@selik.org> wrote:
>
> On Tue, Sep 25, 2018 at 8:46 PM Mikhail V <mikhail...@gmail.com> wrote:
> > I suggest allowing "while:" syntax for the infinite loop.
> > I.e. instead of "while 1:"  and  "while True:" notations.
> >
> > My opinion:
> > 1. I think it'd definitely improve clarity.
>
> I prefer the explicit phrase, ``while True:``. Saying "while" without
> a condition is strange, like a sentence fragment. The ``while 1:``
> pattern is a carryover from Python 2, when ``True`` was not yet a
> keyword.

I like saying while "something": where the string describes the loop's
real condition. For instance, while "moar data": if reading from a
socket, or while "not KeyboardInterrupt": if the loop is meant to be
halted by SIGINT.

ChrisA
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to