why no "do : until"?

Alex Martelli aleaxit at yahoo.com
Thu Jan 4 16:42:04 EST 2001


Bjorn Pettersen" <pbjorn at uswest.net> wrote in message
news:3A54B6BA.F4550C96 at uswest.net...
    [snip]
> > I *WOULD* mind, *A LOT*, if, rather than regularizing syntax for the
> > general form of loop, Python were to add other special-cases with
> > their own syntax variations.  *SIMPLICITY*!  *ONE* general loop form
>
> I guess this is where our opinions differ. I'm of the school of "make the
> general case easy, but make the common case trivial". This means I'm
strongly
> in favor of adding special cases for often used looping constructs. I'm
_not_

No issue with that -- it's just a matter of defining how 'often' must
'often'
be to warrant complicating the language. "for" is a special case, but as
it's
used for roughly 50% of the loops (depending on style), I'm happy it's
singled out in the language.  THAT is special enough for me:-).

> probably argue for special syntax for the Pythonic "for i in
> range(len(sequence))"... (perhaps "for i in 1..10" or perhaps a special
form of
> list comprehensions "for i in [1..10 by 2]" <wink>)

Surely, if a special syntax existed for what's now written as "range(1,10)",
it would be absurd to restrict it to being used in for loops -- why add
rules
(complication) to _diminish_ expressiveness?  I know that a PEP on such
a proposal was reently rejected, but I don't know why.


Alex






More information about the Python-list mailing list