[Python-Dev] Adding an rslice() builtin?

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Aug 29 11:37:47 CEST 2006


Nick Coghlan wrote:

>    reversed(seq[start:stop:step]) becomes seq[(stop-1)%abs(step):start-1:-step]
> 
> An rslice builtin would make the latter version significantly easier to read:
> 
>    seq[rslice(start, stop, step)]

How would this deal with omitted start and/or stop values?

--
Greg


More information about the Python-Dev mailing list