Looping constructs

Peter Hansen peter at engcorp.com
Sun Dec 23 11:13:40 EST 2001


Janos Blazi wrote:
> 
> There is one thing I envy Perl programmers: they have several nice looping
> constructs and Python has almost none. For exmaple redo unless can be nice
> sometimes and they have several others. What do you think about adding such
> contructs to Python?

This is a frequent quasi-religious discussion around here,
with the same general conclusion each time.  Many newcomers
and a few long-time Pythonistas want such a thing, but 
the majority seems relatively content with what we already
have.  I, for one, find it much easier to start my loop
with "while 1:" and then stick the logic where it needs
to be with "if xxxx: break" and continue and such than
to guess at the right mystical loop/until/repeat/never/huh?
construct which is used so rarely I never get the logic
inversion correct...

-- 
----------------------
Peter Hansen, P.Eng.
peter at engcorp.com



More information about the Python-list mailing list