mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
The previous made the stop argument optional.
It is better to be explicit and just allow stop to be None.
This commit is contained in:
parent
14ef54cd83
commit
341deb74e7
3 changed files with 10 additions and 13 deletions
|
@ -477,7 +477,7 @@ islice_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
isliceobject *lz;
|
||||
|
||||
numargs = PyTuple_Size(args);
|
||||
if (!PyArg_ParseTuple(args, "O|OOl:islice", &seq, &a1, &a2, &step))
|
||||
if (!PyArg_ParseTuple(args, "OO|Ol:islice", &seq, &a1, &a2, &step))
|
||||
return NULL;
|
||||
|
||||
if (numargs == 2) {
|
||||
|
@ -491,7 +491,7 @@ islice_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
return NULL;
|
||||
}
|
||||
}
|
||||
} else if (numargs == 3 || numargs == 4) {
|
||||
} else {
|
||||
start = PyInt_AsLong(a1);
|
||||
if (start == -1 && PyErr_Occurred()) {
|
||||
PyErr_Clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue