This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Odd slicing behaviour
Type: behavior Stage:
Components: Regular Expressions Versions: Python 2.6
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: LambertDW, dgaletic, pitrou
Priority: normal Keywords:

Created on 2009-01-22 02:01 by dgaletic, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg80354 - (view) Author: Dinko Galetić (dgaletic) Date: 2009-01-22 02:01
#the following code should return an empty list, but returns the 0th
member of the list

>>> foo = [1, 2, 3]
>>> foo[0::-1]
[1]
msg80360 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-01-22 08:27
Why should it return an empty list?

>>> foo = [1,2,3]
>>> foo[1::-1]
[2, 1]
>>> foo[0::-1]
[1]

looks quite consistent to me.
History
Date User Action Args
2022-04-11 14:56:44adminsetgithub: 49279
2009-01-22 08:45:17georg.brandlsetstatus: open -> closed
resolution: works for me
2009-01-22 08:27:53pitrousetnosy: + pitrou
messages: + msg80360
2009-01-22 02:48:24LambertDWsetnosy: + LambertDW
2009-01-22 02:01:13dgaleticcreate