extended slicing and negative stop value problem
maxmoroz at gmail.com
Sat Aug 20 20:20:47 CEST 2011
Would it be a good idea to change Python definition so that a[10, -1, -1]
referred to the elements starting with position 10, going down to the
This would require disabling the "negative stop value means counting from
the end of the array" magic whenever the step value is negative.
The reason for this idea is that many people (me including) try to use
extended slices with negative step values, only to realize that they are
messed up. For example, if your stop value is reduced in a loop from a
positive number to -1, the behavior breaks whenever it hits -1.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list