[Python-ideas] "while:" for the loop

Michael Selik mike at selik.org
Tue Sep 25 22:34:07 EDT 2018


On Tue, Sep 25, 2018 at 8:46 PM Mikhail V <mikhailwas at 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.


More information about the Python-ideas mailing list