Mercurial > cpython-lru_cache-weakref
diff Modules/itertoolsmodule.c @ 28930:18082b2d2ebd legacy-trunk
The previous made the stop argument optional.
It is better to be explicit and just allow stop to be None.
| author | Raymond Hettinger <python@rcn.com> |
|---|---|
| date | Fri, 02 May 2003 19:44:20 +0000 |
| parents | 92a1e585abf7 |
| children | 001a90555780 |
line wrap: on
line diff
--- a/Modules/itertoolsmodule.c Fri May 02 19:04:37 2003 +0000 +++ b/Modules/itertoolsmodule.c Fri May 02 19:44:20 2003 +0000 @@ -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();
