why no "do : until"?

Bjorn Pettersen pbjorn at uswest.net
Thu Jan 4 21:38:40 EST 2001


Alex Martelli wrote:

> Bjorn Pettersen" <pbjorn at uswest.net> wrote in message
> news:3A54B6BA.F4550C96 at uswest.net...
>
> > 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.

It was rejected because it used slice notation, but had slightly differing
semantics. I think there is still a desire to come up with simpler syntax for
iteration over a sequence index...

-- bjorn




More information about the Python-list mailing list