[issue24379] slice.literal notation

Joe Jevnik report at bugs.python.org
Tue Jun 9 18:05:59 CEST 2015


Joe Jevnik added the comment:

> What I'm missing is a way to use such an object to actually index/slice something

Sorry, I am not sure I understand what you mean by this? You can pass a slice object, or a tuple of slices in subscript notation.

>>> [1, 2, 3, 4][slice(2)]
[1, 2]


Also, I am not currently subscribed to python-ideas; what is the common practice for posting new threads?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24379>
_______________________________________


More information about the Python-bugs-list mailing list