A suggestion for a do...while loop

All these situations could be handled by making a "while:" with no condition act as "while True:"
But they could also be handled by updating pep8 to make "while True:" the recommended infinite loop syntax and make linters smarter about this (if they aren't already).
There was a big related discussion on Python-list in April (subject "Looping" ). IMHO the cleanest way to denote an infinite loop would be the statement "loop:" Without introducing new keyword I think the optimal would be just "while:" I dont't like "while True:" simply because it does not make enough visual distinction with the "while condition:" statement. E.g. I can have while True: ... while Blue: .... Which adds some extra brain load. So if there was explicit "while:" or "loop:" I would update for it globally in my projects. Mikhail

On 26Jun2017 13:30, Ethan Furman <ethan@stoneleaf.us> wrote:
On 06/26/2017 01:20 PM, Mikhail V wrote:
I dont't like "while True:" simply because it does not make enough visual distinction with the "while condition:" statement.
My "while True:" loops look something like:
while "<meaningful text description here>":
O_o Nice! Cheers, Cameron Simpson <cs@zip.com.au>
participants (3)
-
Cameron Simpson
-
Ethan Furman
-
Mikhail V