[Python-ideas] Updating PEP 315: do-while loops

Antoine Pitrou solipsis at pitrou.net
Sun Apr 26 19:26:31 CEST 2009

Raymond Hettinger <python at ...> writes:
> Yes. Absolutely.
> Though I would like a fair hearing for the "do ... while <cond>:" proposal.

I find it disturbing. First, the condition appears on top but is only evaluated
at the end of the loop. Second, it's not usual for synctatical tokens to be
composed of several words ("do ... while" versus "while", "if", "for", etc.).
Third, it introduces a semi-keyword ("do") which won't be used anywhere else,
and abuses an existing object ("...") as synctatical glue.

I'm in favor of not trying to solve this particular "problem". Keeping the
grammar simple is valuable in itself (look at Javascript, C++...).



More information about the Python-ideas mailing list