if a.index(0,-3) != 3: raise TestFailed, 'list index, -start argument'
if a.index(0,3,4) != 3: raise TestFailed, 'list index, stop argument'
if a.index(0,-3,-2) != 3: raise TestFailed, 'list index, -stop argument'
+if a.index(0,-4*sys.maxint,4*sys.maxint) != 2:
+ raise TestFailed, 'list index, -maxint, maxint argument'
+try:
+ a.index(0, 4*sys.maxint,-4*sys.maxint)
+except ValueError:
+ pass
+else:
+ raise TestFailed, 'list index, maxint,-maxint argument'
+
try:
a.index(2,0,-10)
except ValueError:
int i, start=0, stop=self->ob_size;
PyObject *v;
- if (!PyArg_ParseTuple(args, "O|ii:index", &v, &start, &stop))
+ if (!PyArg_ParseTuple(args, "O|O&O&:index", &v,
+ _PyEval_SliceIndex, &start,
+ _PyEval_SliceIndex, &stop))
return NULL;
if (start < 0) {
start += self->ob_size;