Integers class...?
Bjorn Pettersen
BPettersen at NAREX.com
Thu Mar 7 14:50:35 EST 2002
> From: Magnus Lie Hetland [mailto:mlh at vier.idi.ntnu.no]
>
> With all this talk about iteration etc. I just thought I'd
> chuck in another idea. It is similar to several earlier ideas
> (and may even have been proposed in exactly this form before
> -- I just haven't seen it, or at least can't remember it).
>
> One of the interval syntaxes (e.g. for for-loops) I'd like is
> something like [0, 2 .. 10], similar to Haskell.
[snip]
As was mentioned the last time this proposal came up, it doesn't deal
well with half open intervals, i.e.:
for i in [0, 1, ... len(mySeq)-1]:
is prone to off-by-one errors. By itself though I think it fits in the
"cute" category <wink>, so feel free to write up a PEP suggesting the
change...
-- bjorn
More information about the Python-list
mailing list