Re: list (range) syntax

2007-10-26 Thread Christof Winter
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

Re: [0..9] list (range) syntax

2007-10-25 Thread Wildemar Wildenburger
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

[0..9] list (range) syntax

2007-10-24 Thread Michal Bozon
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

Re: [0..9] list (range) syntax

2007-10-24 Thread Wildemar Wildenburger
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

Re: list (range) syntax

2007-10-24 Thread [EMAIL PROTECTED]
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

Re: [0..9] list (range) syntax

2007-10-24 Thread Michal Bozon
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

Re: list (range) syntax

2007-10-24 Thread Steven D'Aprano
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

RE: list (range) syntax

2007-10-24 Thread Ryan Ginstrom
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

Re: list (range) syntax

2007-10-24 Thread Carl Banks
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