[issue28882] RFC: Slice confusing with negative strides and the 0th element.

2016-12-06 Thread Josh Rosenberg
Josh Rosenberg added the comment: I find this report nigh incomprehensible, but I will admit that I can't seem to find any good explanations of the extended slicing rules in the Python docs. The tutorial covers slicing, but, AFAICT, it never mentions extended slicing at all, not in 3.1.2 or

[issue28882] RFC: Slice confusing with negative strides and the 0th element.

2016-12-05 Thread steven Michalske
steven Michalske added the comment: Argh, I swear I proofread this... print([a[x] for x in [slice(y+3, y-1, -1) for y in range(0, len(a), 4)]]) [[], [7, 7, 6, 5]] Catching my explicit case, I changed my code to: print([a[x] for x in [slice(y+3, y-1 if y > 1 else None, -1) for y in range(0,

[issue28882] RFC: Slice confusing with negative strides and the 0th element.

2016-12-05 Thread steven Michalske
New submission from steven Michalske: The slicing and using inputed math is is necessary to provide a special case to make the code behave as expected. Unless I'm missing something. Like we can't do this, as we loose negative indexing from the end of the file? Let's take the following