Mark Dickinson <dicki...@gmail.com> added the comment:

It's behaving as designed and documented; see the docs here: 
https://docs.python.org/3/library/stdtypes.html#sequence-types-list-tuple-range 
(and particularly note 3).

In your first example, the first `-1` in `x[1:-1:-1]` is interpreted relative 
to the end of the list, so `x[1:-1:-1]` is equivalent to `x[1:9:-1]`.

`x[1::-1]` may give you what you want for the first case.

----------
nosy: +mark.dickinson
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43580>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to