From: Raymond Hettinger Date: Thu, 7 Feb 2008 02:12:52 +0000 (+0000) Subject: Return ints instead of longs for tuple.count() and tuple.index(). X-Git-Tag: v2.6a1~248 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=55285ef44c70b84d6f2acdbec4540dfc22ac5d45;p=python Return ints instead of longs for tuple.count() and tuple.index(). --- diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 69190d53e1..dfd2a162fa 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -478,7 +478,7 @@ tupleindex(PyTupleObject *self, PyObject *args) for (i = start; i < stop && i < Py_SIZE(self); i++) { int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ); if (cmp > 0) - return PyLong_FromSsize_t(i); + return PyInt_FromSsize_t(i); else if (cmp < 0) return NULL; } @@ -499,7 +499,7 @@ tuplecount(PyTupleObject *self, PyObject *v) else if (cmp < 0) return NULL; } - return PyLong_FromSsize_t(count); + return PyInt_FromSsize_t(count); } static int