3 ms·
Why does Guido think that slices syntax is screwed up? I mean, it's not exactly natural, but at least it's consistent (first bound is included, second is exclud
by tomp 13y ago
Why does Guido think that slices syntax is screwed up? I mean, it's not exactly natural, but at least it's consistent (first bound is included, second is excluded):
a = '12345'
a[0:-1] == '1234'
a[-1:0:-1] == '5432'
Personally, I think that "downcounting" slices are rarely used. For code clarity, I prefer reversing the string/list first.
- JeffJenkins 13y agoThis came up on python-ideas recently, there was a long thread: https://mail.python.org/pipermail/python-ideas/2013-October/023733.html https://mail.python.org/pipermail/python-ideas/2013-October/...