diff options
author | Raymond Hettinger <python@rcn.com> | 2009-11-30 21:13:52 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2009-11-30 21:13:52 (GMT) |
commit | 9b4197ba53af85195cd722c4f85effee671c3474 (patch) | |
tree | b2a9b0e04b0620f0c8044593b412ec1c5d1061a3 | |
parent | e09f45a2e35e741e627f0ef49e94b84a28a4e72a (diff) | |
download | cpython-9b4197ba53af85195cd722c4f85effee671c3474.zip cpython-9b4197ba53af85195cd722c4f85effee671c3474.tar.gz cpython-9b4197ba53af85195cd722c4f85effee671c3474.tar.bz2 |
Handle step values other than one.
-rw-r--r-- | Modules/itertoolsmodule.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index 6b5c249..633d0a7 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -3379,7 +3379,7 @@ static PyObject * 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 @@ PyDoc_STRVAR(count_reduce_doc, "Return state information for pickling."); static PyMethodDef count_methods[] = { {"__reduce__", (PyCFunction)count_reduce, METH_NOARGS, count_reduce_doc}, + {NULL, NULL} /* sentinel */ }; PyDoc_STRVAR(count_doc, |