Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: