On Tue, Oct 12, 2010 at 01:50:47PM -0400, Terry Reedy wrote:
> >That seems to be an undocumented feature. I didn't know it was possible
> >to use extra parameters after key in __getitem__.
>
> They never get passed, and as I said above, should not have been
> there in the version I posted. Sorry
On Oct 11, 1:40 am, Antoon Pardon
wrote:
> On Sat, Oct 09, 2010 at 01:37:03AM +, Steven D'Aprano wrote:
> > On Fri, 08 Oct 2010 15:53:17 -0400, Jed Smith wrote:
>
> > > On Fri, Oct 8, 2010 at 1:26 PM, Steven D'Aprano
> > > wrote:
> > >> On Fri, 08 Oct 2010 10:21:16 +0200, Antoon Pardon wrote:
On 10/12/2010 9:52 AM, Antoon Pardon wrote:
On Fri, Oct 08, 2010 at 05:05:26PM -0400, Terry Reedy wrote:
But you really seem to be saying is "What if I sometimes want the
end points included and sometimes do not?" Slice syntax by itself
cannot handle all four cases, only one, one was chosen and
On Fri, Oct 08, 2010 at 05:05:26PM -0400, Terry Reedy wrote:
> But you really seem to be saying is "What if I sometimes want the
> end points included and sometimes do not?" Slice syntax by itself
> cannot handle all four cases, only one, one was chosen and that was
> closed-open.
>
> If you want
Steven D'Aprano writes:
> On Fri, 08 Oct 2010 22:10:35 +0200, Hallvard B Furuseth wrote:
>> Jed Smith writes:
>> a = [1, 2, 3, 4, 5, 6]
>> a[::-1]
>>> [6, 5, 4, 3, 2, 1]
>>
>> Nice. Is there a trick to get a "-0" index too? Other than doing 'i or
>> len(L)' instead of 'i', that is.
>
> W
On Mon, Oct 11, 2010 at 05:35:21AM -0700, Ethan Furman wrote:
> Antoon Pardon wrote:
> >On Sat, Oct 09, 2010 at 01:37:03AM +, Steven D'Aprano wrote:
> >
> >>On Fri, 08 Oct 2010 15:53:17 -0400, Jed Smith wrote:
> >>
> >
> >I stand by that claim. I think it was fairly obvious that what I meant
>
Antoon Pardon wrote:
On Sat, Oct 09, 2010 at 01:37:03AM +, Steven D'Aprano wrote:
On Fri, 08 Oct 2010 15:53:17 -0400, Jed Smith wrote:
On Fri, Oct 8, 2010 at 1:26 PM, Steven D'Aprano
wrote:
On Fri, 08 Oct 2010 10:21:16 +0200, Antoon Pardon wrote:
Personnaly I find it horrible
that
On Mon, Oct 11, 2010 at 06:25:49AM -0400, Dave Angel wrote:
> On 2:59 PM, Antoon Pardon wrote:
> >On Sat, Oct 09, 2010 at 01:37:03AM +, Steven D'Aprano wrote:
> >
> >>But the point was that Antoon claimed that there is no numeric value for
> >>the end position that will include L[0] in the rev
On 2:59 PM, Antoon Pardon wrote:
On Sat, Oct 09, 2010 at 01:37:03AM +, Steven D'Aprano wrote:
But the point was that Antoon claimed that there is no numeric value for
the end position that will include L[0] in the reversed slice. My example
shows that this is not correct.
I stand by that
On Sat, Oct 09, 2010 at 01:37:03AM +, Steven D'Aprano wrote:
> On Fri, 08 Oct 2010 15:53:17 -0400, Jed Smith wrote:
>
> > On Fri, Oct 8, 2010 at 1:26 PM, Steven D'Aprano
> > wrote:
> >> On Fri, 08 Oct 2010 10:21:16 +0200, Antoon Pardon wrote:
> >>
> >>> Personnaly I find it horrible
> >>> tha
On Fri, 08 Oct 2010 22:10:35 +0200, Hallvard B Furuseth wrote:
> Jed Smith writes:
> a = [1, 2, 3, 4, 5, 6]
> a[::-1]
>> [6, 5, 4, 3, 2, 1]
>
> Nice. Is there a trick to get a "-0" index too? Other than doing 'i or
> len(L)' instead of 'i', that is.
What exactly are you expecting? I do
On Fri, 08 Oct 2010 15:53:17 -0400, Jed Smith wrote:
> On Fri, Oct 8, 2010 at 1:26 PM, Steven D'Aprano
> wrote:
>> On Fri, 08 Oct 2010 10:21:16 +0200, Antoon Pardon wrote:
>>
>>> Personnaly I find it horrible
>>> that in the following expression: L[a:b:-1], it is impossible to give
>>> a numeric
On Oct 8, 3:05 pm, Terry Reedy wrote:
> > doesn't imply that the sequence I need is easiest defined by
> > using aninclusivelower limit. What if I wanted all none-empty
> > strings/tuples keys in the tree?
>
> Use 'a' as the lower bound, it being the string that follows ''.
No, that would be '\0'
On 10/8/2010 4:21 AM, Antoon Pardon wrote:
On Wed, Oct 06, 2010 at 05:28:13PM -0400, Terry Reedy wrote:
Strings and tuples are not natural numbers, but do have least
members ('' and ()), so the bottom end had better be closed.
Why?
Because otherwise one can never include the least member i
Hallvard B Furuseth writes:
> Jed Smith writes:
> a = [1, 2, 3, 4, 5, 6]
> a[::-1]
>> [6, 5, 4, 3, 2, 1]
>
> Nice. Is there a trick to get a "-0" index too?
> Other than doing 'i or len(L)' instead of 'i', that is.
>
L = [1,2,3,4,5]
L[2:-2], L[2:-1], L[2:-0] # not quite right
Jed Smith writes:
> On Fri, Oct 8, 2010 at 1:26 PM, Steven D'Aprano
> wrote:
>> On Fri, 08 Oct 2010 10:21:16 +0200, Antoon Pardon wrote:
>>
>>> Personnaly I find it horrible
>>> that in the following expression: L[a:b:-1], it is impossible to give a
>>> numeric value to b, that will include L[0]
Jed Smith writes:
a = [1, 2, 3, 4, 5, 6]
a[::-1]
> [6, 5, 4, 3, 2, 1]
Nice. Is there a trick to get a "-0" index too?
Other than doing 'i or len(L)' instead of 'i', that is.
>>> L = [1,2,3,4,5]
>>> L[2:-2], L[2:-1], L[2:-0] # not quite right:-)
([3], [3, 4], [])
--
Hallvard
--
htt
On Fri, Oct 8, 2010 at 1:26 PM, Steven D'Aprano
wrote:
> On Fri, 08 Oct 2010 10:21:16 +0200, Antoon Pardon wrote:
>
>> Personnaly I find it horrible
>> that in the following expression: L[a:b:-1], it is impossible to give a
>> numeric value to b, that will include L[0] into the reversed slice.
>
>
On Fri, 08 Oct 2010 10:21:16 +0200, Antoon Pardon wrote:
> Personnaly I find it horrible
> that in the following expression: L[a:b:-1], it is impossible to give a
> numeric value to b, that will include L[0] into the reversed slice.
>>> L = [1, 2, 3, 4, 5]
>>> L[5:-6:-1]
[5, 4, 3, 2, 1]
--
On Wed, Oct 06, 2010 at 05:28:13PM -0400, Terry Reedy wrote:
> On 10/6/2010 7:14 AM, Antoon Pardon wrote:
>
> >>That right-hand-half-open intervals (i.e. a<= i< b, equivalently [a,
> >>b) ), which are what Python uses, are to be preferred.
> >>(See aforelinked PDF: http://www.cs.utexas.edu/users/
On 10/6/2010 7:14 AM, Antoon Pardon wrote:
That right-hand-half-open intervals (i.e. a<= i< b, equivalently [a,
b) ), which are what Python uses, are to be preferred.
(See aforelinked PDF: http://www.cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF)
This specifically discusses subsequences of 'natu
In message , Antoon
Pardon wrote:
> Or what if the keys were floats or tuples and I wanted an
> inclusive upper boundary?
If you’re expecting computer floats to behave as mathematically exact
quantities, you’re asking for trouble.
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Oct 05, 2010 at 01:52:39PM -0700, Chris Rebert wrote:
> On Tue, Oct 5, 2010 at 1:31 PM, Wolfgang Rohdewald
> wrote:
> > On Dienstag 05 Oktober 2010, MRAB wrote:
> >> > About notation, even if loved right-hand-half-open
> >> > intervals, I would wonder about [a,b] noting it. I guess
> >> >
On Tue, Oct 5, 2010 at 1:31 PM, Wolfgang Rohdewald
wrote:
> On Dienstag 05 Oktober 2010, MRAB wrote:
>> > About notation, even if loved right-hand-half-open
>> > intervals, I would wonder about [a,b] noting it. I guess
>> > 99.9% of programmers and novices (even purely amateur) have
>> > learnt ab
On Dienstag 05 Oktober 2010, MRAB wrote:
> > About notation, even if loved right-hand-half-open
> > intervals, I would wonder about [a,b] noting it. I guess
> > 99.9% of programmers and novices (even purely amateur) have
> > learnt about intervals at school in math courses. Both
> > notations I kno
On 05/10/2010 20:23, spir wrote:
On Tue, 05 Oct 2010 13:45:56 +0200
Boris Borcic wrote:
Nick Coghlan wrote:
[...] Being able to say things like
"10:00"<= x< '12:00", 10.0<= x< 12.0, "a"<= x< "n" are much
clearer than trying to specify their closed range equivalents.
makes one wonder a
26 matches
Mail list logo