[OT] Re: number ranges

2006-02-22 Thread Sion Arrowsmith
Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> Colin J. Williams <[EMAIL PROTECTED]> wrote: >>>1. Why not treat '2 to 5' or '(2 to 5)' as a semi-open interval? >I intellectually understand that semi-open intervals >are the only way to go. But reading the words, the part >of my brain that speaks E

Re: number ranges

2006-02-22 Thread Antoon Pardon
Op 2006-02-21, Tim Hochberg schreef <[EMAIL PROTECTED]>: > > [Lots of proposals snipped] > > 90% of my gripes with range disappeared with the addition of enumerate. > However, if there's going to be another round of range literal proposals > I might as well throw out what seems (to me anyway) lik

Re: number ranges (was Re: Matlab page on scipy wiki)

2006-02-22 Thread Antoon Pardon
Op 2006-02-20, Steven D'Aprano schreef <[EMAIL PROTECTED]>: > John Zenger wrote: > >> I strongly agree that Python should promote range or xrange to syntax. I >> favor [0..10] rather than [0:10] because 0..10 is inherently easier to >> understand. > > "Inherently"? > > You mean people are born wi

Re: number ranges

2006-02-21 Thread Colin J. Williams
Alex Martelli wrote: > Steven D'Aprano <[EMAIL PROTECTED]> wrote: >... > >>>Reread the part I quoted above: at least some of the proponents of this >>>syntax appear to be totally ignorant of 30 years of literature and >>>practice of programming, "it will be tough to convince" them that closed

Re: number ranges

2006-02-21 Thread Tim Hochberg
[Lots of proposals snipped] 90% of my gripes with range disappeared with the addition of enumerate. However, if there's going to be another round of range literal proposals I might as well throw out what seems (to me anyway) like the only halfway obvious choice in the context of Python. 1. a:

Re: number ranges

2006-02-21 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > > for i in (1 to 10 by 3): > > print i > > > > should print 1 4 7. > > But that would be an "attractive nuisance" to many other native speakers > like you, who would instinctively think of a closed interval. Maybe > 'upto' rather than 'to', as som

Re: number ranges

2006-02-21 Thread Alex Martelli
Steven D'Aprano <[EMAIL PROTECTED]> wrote: ... > > Reread the part I quoted above: at least some of the proponents of this > > syntax appear to be totally ignorant of 30 years of literature and > > practice of programming, "it will be tough to convince" them that closed > > intervals are a terri

Re: number ranges

2006-02-21 Thread Steven D'Aprano
Alex Martelli wrote: > Colin J. Williams <[EMAIL PROTECTED]> wrote: >... > I am also open to such arguments but it will be tough to convince me that "x to y" should mean something different from what it means in Pascal, BASIC, and English. >>> >... > >>1. Why not treat '2 to

Re: number ranges

2006-02-20 Thread Alex Martelli
Colin J. Williams <[EMAIL PROTECTED]> wrote: ... > >>I am also open to such arguments but it will be tough to convince me > >>that "x to y" should mean something different from what it means in > >>Pascal, BASIC, and English. ... > 1. Why not treat '2 to 5' or '(2 to 5)' as a semi-open interv

Re: number ranges

2006-02-20 Thread Colin J. Williams
Alex Martelli wrote: > John Zenger <[EMAIL PROTECTED]> wrote: >... > >>>for i in 2 to 5: >>>print i, >>> >>>which would print 2 3 4 5 >> >>This proposed syntax is also easy to understand, maybe more than "..", >>because it uses natural language. The only criticism is that it creates >>a l

Re: number ranges (was Re: Matlab page on scipy wiki)

2006-02-20 Thread Colin J. Williams
Steven D'Aprano wrote: > John Zenger wrote: > >> I strongly agree that Python should promote range or xrange to syntax. >> I favor [0..10] rather than [0:10] because 0..10 is inherently easier >> to understand. > > > "Inherently"? > > You mean people are born with an instinctive, unlearnt und

Re: number ranges

2006-02-20 Thread Alex Martelli
John Zenger <[EMAIL PROTECTED]> wrote: ... > > for i in 2 to 5: > > print i, > > > > which would print 2 3 4 5 > > This proposed syntax is also easy to understand, maybe more than "..", > because it uses natural language. The only criticism is that it creates > a list without using [] not

Re: number ranges (was Re: Matlab page on scipy wiki)

2006-02-20 Thread Tim Hochberg
[EMAIL PROTECTED] wrote: > Tim Hochberg wrote: > >>Colin J. Williams wrote: >> >> It would be good if the range and slice could be merged in some way, although the extended slice is rather complicated - I don't understand it. The semantics for an extended slicing are as follows.

Re: number ranges (was Re: Matlab page on scipy wiki)

2006-02-20 Thread John Zenger
Steven D'Aprano wrote: > John Zenger wrote: > >> I strongly agree that Python should promote range or xrange to syntax. >> I favor [0..10] rather than [0:10] because 0..10 is inherently easier >> to understand. > > "Inherently"? > > You mean people are born with an instinctive, unlearnt unders

Re: number ranges (was Re: Matlab page on scipy wiki)

2006-02-20 Thread Steven D'Aprano
John Zenger wrote: > I strongly agree that Python should promote range or xrange to syntax. I > favor [0..10] rather than [0:10] because 0..10 is inherently easier to > understand. "Inherently"? You mean people are born with an instinctive, unlearnt understanding of ..? Or that our brains are

Re: number ranges (was Re: Matlab page on scipy wiki)

2006-02-19 Thread bonono
Tim Hochberg wrote: > Colin J. Williams wrote: > > >> > >>It would be good if the range and slice could be merged in some way, > >>although the extended slice is rather complicated - I don't understand it. > >> > >> The semantics for an extended slicing are as follows. The primary > >> must ev

Re: number ranges (was Re: Matlab page on scipy wiki)

2006-02-19 Thread Erik Max Francis
John Zenger wrote: > I strongly agree that Python should promote range or xrange to syntax. > I favor [0..10] rather than [0:10] because 0..10 is inherently easier to > understand. Every maths text I have read uses the ".." notation to show > ranges; Math texts typically use a normal ellipsi

Re: number ranges (was Re: Matlab page on scipy wiki)

2006-02-19 Thread John Zenger
Colin J. Williams wrote: > Bryan Cole wrote: > >>> >>> First, I think the range() function in python is ugly to begin with. >>> Why can't python just support range notation directly like 'for a in >>> 0:10'. Or with 0..10 or 0...10 syntax. That seems to make a lot more >>> sense to me tha

Re: number ranges (was Re: Matlab page on scipy wiki)

2006-02-19 Thread Tim Hochberg
Colin J. Williams wrote: >> >>It would be good if the range and slice could be merged in some way, >>although the extended slice is rather complicated - I don't understand it. >> >> The semantics for an extended slicing are as follows. The primary >> must evaluate to a mapping object, and it i

Re: number ranges (was Re: Matlab page on scipy wiki)

2006-02-19 Thread Colin J. Williams
Colin J. Williams wrote: > Bryan Cole wrote: > >>> >>> First, I think the range() function in python is ugly to begin with. >>> Why can't python just support range notation directly like 'for a in >>> 0:10'. Or with 0..10 or 0...10 syntax. That seems to make a lot more >>> sense to me tha

Re: number ranges (was Re: Matlab page on scipy wiki)

2006-02-19 Thread Colin J. Williams
Bryan Cole wrote: >> >> >>First, I think the range() function in python is ugly to begin with. >>Why can't python just support range notation directly like 'for a in >>0:10'. Or with 0..10 or 0...10 syntax. That seems to make a lot more >>sense to me than having to call a named function.