]> granicus.if.org Git - python/commitdiff
Return ints instead of longs for tuple.count() and tuple.index().
authorRaymond Hettinger <python@rcn.com>
Thu, 7 Feb 2008 02:12:52 +0000 (02:12 +0000)
committerRaymond Hettinger <python@rcn.com>
Thu, 7 Feb 2008 02:12:52 +0000 (02:12 +0000)
Objects/tupleobject.c

index 69190d53e1d47997c7819a3a1e51970ba8fc5971..dfd2a162fa3b1dd5d212f9cb7398b1c4002c943a 100644 (file)
@@ -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