The previous made the stop argument optional.
It is better to be explicit and just allow stop to be None.
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 @@
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 @@
return NULL;
}
}
- } else if (numargs == 3 || numargs == 4) {
+ } else {
start = PyInt_AsLong(a1);
if (start == -1 && PyErr_Occurred()) {
PyErr_Clear();