Also make _heapq.nlargest() use Py_ssize_t instead of ints, to iter over
authorThomas Wouters <thomas@python.org>
Thu, 16 Feb 2006 19:21:53 +0000 (19:21 +0000)
committerThomas Wouters <thomas@python.org>
Thu, 16 Feb 2006 19:21:53 +0000 (19:21 +0000)
lists and call Py_ssize_t-using helpers. All other code in this module was
already adapted to Py_ssize_t.

Modules/_heapqmodule.c

index 36427690b1eba2e84d56dd1900ee189b6b8f204a..f970cae91377cc683aa82f3277d900e236ff51e1 100644 (file)
@@ -227,9 +227,9 @@ static PyObject *
 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);