do .. while loops ?

Erik Max Francis max at alcyone.com
Sun Jul 15 01:09:01 EDT 2001


Paul Andreassen wrote:

> Could someone please tell me why "do .. while" loops are not part of
> the
> python language?  I realise they are rarely used but the
> implementation
> should be easy.
> 
> Thanks for any reply, except abuse.

I think just simplicity.  Doing

	while 1:
	    ...
	    if not (condition): break

is pretty clear.

do...while loops are a language feature that tend to be fairly
controversial in some languages, for some reason -- probably because it
seems more on the "fluff" side to many people.  They're easy enough to
simulate with other control structures.

I certainly wouldn't have minded them being in Python, but by the same
token I don't miss them either.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Do you like what you see / Do you like yourself
\__/ Neneh Cherry
    Polly Wanna Cracka? / http://www.pollywannacracka.com/
 The Internet resource for interracial relationships.



More information about the Python-list mailing list