list (range) syntax

mensanator at aol.com mensanator at aol.com
Wed Oct 24 19:28:20 EDT 2007


On Oct 24, 5:44 pm, Michal Bozon <boz... at vscht.cz> wrote:
> many Python newcomers are confused why
> range(10), does not include 10.

How can they be confused?

Does base 10 have a digit ten?
Does base  2 have a digit two?
Does base 16 have a digit sixteen?

Haven't you stopped counting on your fingers when
you leave grade school?

>
> If there was a proposal for the new
> syntax for ranges, which is known
> e.g. from Pascal or Ruby...
>
> >>> [0..10]
>
> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>
> ...is there a chance to be approved ?

"These go to 11."

>
> We have had a short discussion on it
> at the irc, I hope that the fact
> that nobody agreed it is a good idea
> was just an accident :)

Wait a minute...comp.lang.python. I must have
accidentally gotten into the wrong newsgroup.

>
>  -m.
>
> PS:
> to dream further..
>
> >>> (0..10)
>
> <generator object at 0xb7618dac>
>
> or
>
> >>> (0..10)
>
> (0..10)
>
> or
>
> >>> (0..10)
>
> range(0, 11)





More information about the Python-list mailing list