Mercurial > cpython-lru_cache-weakref
diff Modules/itertoolsmodule.c @ 57519:0cf99158fa63 legacy-trunk
Handle step values other than one.
| author | Raymond Hettinger <python@rcn.com> |
|---|---|
| date | Mon, 30 Nov 2009 21:13:52 +0000 |
| parents | 2816650d7688 |
| children | fd25030223b0 |
line wrap: on
line diff
--- a/Modules/itertoolsmodule.c Mon Nov 30 19:44:40 2009 +0000 +++ b/Modules/itertoolsmodule.c Mon Nov 30 21:13:52 2009 +0000 @@ -3379,7 +3379,7 @@ count_reduce(countobject *lz) { if (lz->cnt == PY_SSIZE_T_MAX) - return Py_BuildValue("O(O)", Py_TYPE(lz), lz->long_cnt); + return Py_BuildValue("O(OO)", Py_TYPE(lz), lz->long_cnt, lz->long_step); return Py_BuildValue("O(n)", Py_TYPE(lz), lz->cnt); } @@ -3388,6 +3388,7 @@ static PyMethodDef count_methods[] = { {"__reduce__", (PyCFunction)count_reduce, METH_NOARGS, count_reduce_doc}, + {NULL, NULL} /* sentinel */ }; PyDoc_STRVAR(count_doc,
