Commits

Raymond Hettinger  committed 0cf9915

Handle step values other than one.

  • Participants
  • Parent commits 2816650
  • Branches legacy-trunk

Comments (0)

Files changed (1)

File Modules/itertoolsmodule.c

 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);
 }
 
 static PyMethodDef count_methods[] = {
 	{"__reduce__",	(PyCFunction)count_reduce,	METH_NOARGS,
 	 count_reduce_doc},
+	{NULL,		NULL}	/* sentinel */
 };
 
 PyDoc_STRVAR(count_doc,