[Python-ideas] Where did we go wrong with negative stride?

Richard Oudkerk shibturn at gmail.com
Sun Oct 27 18:28:39 CET 2013



On 27/10/2013 5:04pm, Guido van Rossum wrote:
> Are we stuck with this forever? If we want to fix this in Python 4 we'd
> have to start deprecating negative stride with non-empty lower/upper
> bounds now. And we'd have to start deprecating negative step for range()
> altogether, recommending reversed(range(lower, upper)) instead.

Or recommend using None?

 >>> "abcde"[None:None:-1]
'edcba'

-- 
Richard



More information about the Python-ideas mailing list