mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +00:00
Handle step values other than one.
This commit is contained in:
parent
e09f45a2e3
commit
9b4197ba53
1 changed files with 2 additions and 1 deletions
|
|
@ -3379,7 +3379,7 @@ static PyObject *
|
||||||
count_reduce(countobject *lz)
|
count_reduce(countobject *lz)
|
||||||
{
|
{
|
||||||
if (lz->cnt == PY_SSIZE_T_MAX)
|
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);
|
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[] = {
|
static PyMethodDef count_methods[] = {
|
||||||
{"__reduce__", (PyCFunction)count_reduce, METH_NOARGS,
|
{"__reduce__", (PyCFunction)count_reduce, METH_NOARGS,
|
||||||
count_reduce_doc},
|
count_reduce_doc},
|
||||||
|
{NULL, NULL} /* sentinel */
|
||||||
};
|
};
|
||||||
|
|
||||||
PyDoc_STRVAR(count_doc,
|
PyDoc_STRVAR(count_doc,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue