Slicing with negative strides

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Nov 4 16:18:31 CET 2013


On Mon, 04 Nov 2013 00:15:40 +0100, Martin Manns wrote:

> On 29 Oct 2013 05:22:00 GMT
> Steven D'Aprano <steve at pearwood.info> wrote:
> 
>> Does anyone here use slices (or range/xrange) with negative strides
>> other than -1?
> 
> I have used negative strides for comparing discrete sequences e. g. for
> turbulence analysis, and I hope that my code will still run in Python 4.

Can you show us a typical example of how you would normally use such 
negative strides?


Thanks,



-- 
Steven



More information about the Python-list mailing list