On Monday, October 28, 2013 10:22:00 PM UTC-7, Steven D'Aprano wrote:
> Does anyone here use slices (or range/xrange) with negative strides other 
> 
> than -1?
> 

Non default positive strides are very handy, but negative strides seem weird to 
me. Not the negative striding exactly, but the way fenceposts and negative 
strides interact.

For example, this poster seems to posit a canonical WTF with negative strides. 

http://stackoverflow.com/questions/5798136/python-reverse-stride-slicing

I can almost picture Picard saying "WTF do you need to omit the end index to 
get the zero element??!!"

Readability counts, no? Just reverse it and use positive strides. 





-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to