Martin Panter added the comment: I think Steven’s main complaint is that it is hard to make a reversed slice extend to the start of the original sequence, unless you omit (or use None as) the endpoint:
>>> "01234567"[4:0:-1] # Includes index [4], stops before reaching index [0] '4321' >>> "01234567"[3::-1] # Includes index [3], stop omitted for start of string '3210' >>> "01234567"[3:None:-1] # None means the same '3210' >>> "01234567"[3:-1:-1] # Negative means len(...) - 1, i.e. index [7] '' This is a consequence of (a) the stop parameter meaning “stop _before_ reaching this index”, and (b) negative indexes are interpreted specially as being relative to the end. ---------- nosy: +martin.panter _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28882> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com