Also make _heapq.nlargest() use Py_ssize_t instead of ints, to iter over
lists and call Py_ssize_t-using helpers. All other code in this module was
already adapted to Py_ssize_t.
diff --git a/Modules/_heapqmodule.c b/Modules/_heapqmodule.c
index 3642769..f970cae 100644
--- a/Modules/_heapqmodule.c
+++ b/Modules/_heapqmodule.c
@@ -227,9 +227,9 @@
nlargest(PyObject *self, PyObject *args)
{
PyObject *heap=NULL, *elem, *iterable, *sol, *it, *oldelem;
- int i, n;
+ Py_ssize_t i, n;
- if (!PyArg_ParseTuple(args, "iO:nlargest", &n, &iterable))
+ if (!PyArg_ParseTuple(args, "nO:nlargest", &n, &iterable))
return NULL;
it = PyObject_GetIter(iterable);