Looping [was Re: Python and the need for speed]

Marko Rauhamaa marko at pacujo.net
Tue Apr 18 00:41:26 EDT 2017


Ben Bacarisse <ben.usenet at bsb.me.uk>:

> Python opts for
>
>   while True:
>      c = sys.stdin.read(1)
>      if c != ' ': break

I opt for that in C and bash as well.

In fact, when I start writing a loop, I first type:

    while True:
        <cursor>

Once it is done, I might notice that the loop begins:

    while True:
        if ...
            break

and merge "while" and "if".


Marko


More information about the Python-list mailing list