diff options
author | Raymond Hettinger <python@rcn.com> | 2003-05-02 19:44:20 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-05-02 19:44:20 (GMT) |
commit | 341deb74e7ec78eaf99838669ce04871e9f15783 (patch) | |
tree | c3c8257703ef5e718c8f850945dc2e7070f25071 /Modules | |
parent | 14ef54cd833c7ccfa0b3d03e2b45074d54a8ac87 (diff) | |
download | cpython-341deb74e7ec78eaf99838669ce04871e9f15783.zip cpython-341deb74e7ec78eaf99838669ce04871e9f15783.tar.gz cpython-341deb74e7ec78eaf99838669ce04871e9f15783.tar.bz2 |
The previous made the stop argument optional.
It is better to be explicit and just allow stop to be None.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/itertoolsmodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index f05ebd6..2d496b5 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -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(); |