[issue13340] list.index does not accept None as start or stop

Mark Dickinson report at bugs.python.org
Sun Nov 6 12:28:00 CET 2011


Mark Dickinson <dickinsm at gmail.com> added the comment:

> What do you suggest? Doing it in _PyEval_SliceIndex() in 2.7 is
> problematic, as we don't want x[None:2], right? :)

Eh? Don't we already have this?

Python 2.7.2 (default, Aug 22 2011, 13:53:27) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> range(5)[None:2]
[0, 1]

Or am I misunderstanding?

----------
nosy: +mark.dickinson

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


More information about the Python-bugs-list mailing list