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

Petri Lehtinen report at bugs.python.org
Sat Nov 5 22:46:25 CET 2011


Petri Lehtinen <petri at digip.org> added the comment:

> 2) It probably should have been done in _PyEval_SliceIndex().

I saw that other code used the same approach as I used in the fix.

The comment above _PyEval_SliceIndex() suggests it's used in other
contexts too. It seems that 2.7 uses it to implement the SLICE opcode,
while in 3.x it's only used to convert slice-like arguments.

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

----------

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


More information about the Python-bugs-list mailing list