Ryan Ginstrom wrote:
On Behalf Of Steven D'Aprano
Because in common English, counting starts at 1 and ranges
normally include both end points (that is, it is a closed
interval). If you say I'll be away from the 4th to the 7th
and then turn up on the 7th, nearly everyone will wonder why
Michal Bozon wrote:
The .. syntax was not meant only as something
which would include the last item,
but also/rather a range list syntactic shortcut:
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] --
[0, 1, ... 9, 10] --
[0..10]
OK, I see.
But I still fail to see where this is useful. All these 3
many Python newcomers are confused why
range(10), does not include 10.
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 ?
We have had a short discussion on it
at the
Michal Bozon wrote:
many Python newcomers are confused why
range(10), does not include 10.
It produces a list of ten elements. Also the documentation is quite
clear on the topic. And lastly: This will probably really bother you for
a week, then no more.
If there was a proposal for the new
On Oct 24, 5:44 pm, Michal Bozon [EMAIL PROTECTED] 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
On Thu, 25 Oct 2007 01:16:57 +0200, Wildemar Wildenburger wrote:
Michal Bozon wrote:
many Python newcomers are confused why
range(10), does not include 10.
It produces a list of ten elements. Also the documentation is quite
clear on the topic. And lastly: This will probably really bother
On Wed, 24 Oct 2007 16:28:20 -0700, [EMAIL PROTECTED] wrote:
On Oct 24, 5:44 pm, Michal Bozon [EMAIL PROTECTED] wrote:
many Python newcomers are confused why range(10), does not include 10.
How can they be confused?
Because in common English, counting starts at 1 and ranges normally
On Behalf Of Steven D'Aprano
Because in common English, counting starts at 1 and ranges
normally include both end points (that is, it is a closed
interval). If you say I'll be away from the 4th to the 7th
and then turn up on the 7th, nearly everyone will wonder why
you're back a day
On Oct 24, 6:44 pm, Michal Bozon [EMAIL PROTECTED] wrote:
many Python newcomers are confused why
range(10), does not include 10.
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