Mailing List Archive

[issue5029] Odd slicing behaviour
New submission from Dinko Galetić <dinko.galetic@gmail.com>:

#the following code should return an empty list, but returns the 0th
member of the list

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

----------
components: Regular Expressions
messages: 80354
nosy: dgaletic
severity: normal
status: open
title: Odd slicing behaviour
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue5029>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue5029] Odd slicing behaviour [ In reply to ]
Changes by David W. Lambert <lambertdw@corning.com>:


----------
nosy: +LambertDW

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue5029>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue5029] Odd slicing behaviour [ In reply to ]
Antoine Pitrou <pitrou@free.fr> added the comment:

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.

----------
nosy: +pitrou

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue5029>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue5029] Odd slicing behaviour [ In reply to ]
Changes by Georg Brandl <georg@python.org>:


----------
resolution: -> works for me
status: open -> closed

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue5029>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com