[EMAIL PROTECTED] wrote:
> Robert Kern wrote:
>> I'd say bug in the .indices() method. The meaning of [4:-1:-1] is unavoidable
>> different than [::-1] since the index -1 points to the last element, not the
>> imaginary element before the first element. Unfortunately, there *is* no
>> concrete (sta
Robert Kern wrote:
> I'd say bug in the .indices() method. The meaning of [4:-1:-1] is unavoidable
> different than [::-1] since the index -1 points to the last element, not the
> imaginary element before the first element. Unfortunately, there *is* no
> concrete (start, stop, step) tuple that wil
[EMAIL PROTECTED] wrote:
> The indices method of slice doesn't seem to work quite how I would
> expect when reversing a sequence.
>
> For example :
s = '01234'
s[::-1]
> '43210'
s[slice(None,None,-1) ]
> '43210'
>
> So a slice with a negative step (and nothing else) reverses the
>
The indices method of slice doesn't seem to work quite how I would
expect when reversing a sequence.
For example :
>>> s = '01234'
>>> s[::-1]
'43210'
>>> s[slice(None,None,-1) ]
'43210'
So a slice with a negative step (and nothing else) reverses the
sequence. But what are the
corresponding indi