[Python-checkins] r42424 - python/trunk/Modules/_heapqmodule.c

thomas.wouters python-checkins at python.org
Thu Feb 16 20:21:56 CET 2006


Author: thomas.wouters
Date: Thu Feb 16 20:21:53 2006
New Revision: 42424

Modified:
   python/trunk/Modules/_heapqmodule.c
Log:

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.



Modified: python/trunk/Modules/_heapqmodule.c
==============================================================================
--- python/trunk/Modules/_heapqmodule.c	(original)
+++ python/trunk/Modules/_heapqmodule.c	Thu Feb 16 20:21:53 2006
@@ -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);


More information about the Python-checkins mailing list