Hacker News new | ask | show | jobs
by tomp 4603 days 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.
1 comments

This came up on python-ideas recently, there was a long thread: https://mail.python.org/pipermail/python-ideas/2013-October/...