Arithmetic sequences in Python

Alex Martelli aleax at mail.comcast.net
Mon Jan 16 15:08:14 EST 2006


Roy Smith <roy at panix.com> wrote:

> Alex Martelli <aleax at mail.comcast.net> wrote:
> >Agreed.  *IF* we truly needed an occasional "up to X *INCLUDED*"
> >sequence, it should be in a syntax that can't FAIL to be noticed, such
> >as range(X, endincluded=True).
> 
> How about...
> 
> for i in (0..x]:
>     blah

The difference between a round parenthesis and a square bracket can
EASILY be overlooked, depending partly on what font you're using.


Alex



More information about the Python-list mailing list