No Do while/repeat until looping construct in python?

William Sonna wsonna at attglobal.net
Wed Mar 12 21:00:00 EST 2003


On Wed, 12 Mar 2003 22:24:24 -0600, Lars W wrote:

> Hello!
> 
> 	Why is there no do-while looping construct in Python?


Because the person(s) who decide the language refuse to face up to the
fact that they screwed up by not including it.  Its an obvious flaw that
dogma prevents from being corrected.

Its not going to change, either, so file it right next to "self" as the
second of the two most-hated "features" of the language.  The problem is
that as a relatively small language, you can't escape them.

The workaround for (no) repeat is to brake after the test placed at the
end of the loop.

The workaround for "self" is to assign a local variable and use it
instead.

Ugly as sin - but they do work.  And they are a hell of a lot easier than
learning Japanese in order to learn a rival scripting language that
doesn't suffer from these particular idiosyncracies.





More information about the Python-list mailing list