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
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
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
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
[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:
[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
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
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
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
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
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
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
[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.
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
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
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
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
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
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
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
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.
21 matches
Mail list logo