[Python-ideas] Immemorial desire for "do-while"-like construction
zuo at chopin.edu.pl
Thu Jul 16 00:50:06 CEST 2009
The issue has been coming back repeatedly:
How we could elegantly and pythonic'ly avoid repeating ourselves if
we need the control flow structure that e.g. in PASCAL has the form:
In Python we must use while-loop in not very DRY (Don't Repeat
Maybe here the simplest approach can lead us to the solution? I.e.:
repeat while CONDITION:
In human language it'd mean: do ACTIONS once unconditionally, then
*repeat* them while the CONDITION is true.
Additional advantage is that probably for many people associate
'repeat' with such construction (from experience with other languages).
What do you think about the idea?
Jan Kaliszewski <zuo at chopin.edu.pl>
More information about the Python-ideas