28 Oct
2013
28 Oct
'13
7:47 p.m.
On Mon, Oct 28, 2013 at 7:13 PM, Nick Coghlan <ncoghlan@gmail.com> wrote: ..
to effectively mean:
range(i, j, k)[::-1]
and for:
s[slice(i, j, k, reverse=True)]
to effectively mean:
s[i:j:k][::-1]
range and slice would handle the appropriate start/stop/step calculations under the hood and hence be backwards compatible with existing container implementations and other code.
This approach also means we could avoid addressing the slice reversal syntax question for 3.4, and revisit it in the 3.5 time frame (and ditto for deprecating negative strides). However, the idea of just allowing keyword args to be passed to the slice builtin in the slice syntax did occur to me:
s[i:j:k:reverse=True]
+1 In fact, I suggested the same before reading your e-mail.