summaryrefslogtreecommitdiffstats
path: root/Objects/iterobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/iterobject.c')
-rw-r--r--Objects/iterobject.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/Objects/iterobject.c b/Objects/iterobject.c
index 5a9a2dd..91a93f5 100644
--- a/Objects/iterobject.c
+++ b/Objects/iterobject.c
@@ -81,9 +81,9 @@ iter_len(seqiterobject *it)
return NULL;
len = seqsize - it->it_index;
if (len >= 0)
- return PyInt_FromSsize_t(len);
+ return PyLong_FromSsize_t(len);
}
- return PyInt_FromLong(0);
+ return PyLong_FromLong(0);
}
PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it)).");
@@ -103,7 +103,7 @@ PyTypeObject PySeqIter_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_compare */
+ 0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -177,9 +177,7 @@ calliter_iternext(calliterobject *it)
Py_DECREF(args);
if (result != NULL) {
int ok;
- ok = PyObject_RichCompareBool(result,
- it->it_sentinel,
- Py_EQ);
+ ok = PyObject_RichCompareBool(it->it_sentinel, result, Py_EQ);
if (ok == 0)
return result; /* Common case, fast path */
Py_DECREF(result);
@@ -199,7 +197,7 @@ calliter_iternext(calliterobject *it)
PyTypeObject PyCallIter_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
- "callable-iterator", /* tp_name */
+ "callable_iterator", /* tp_name */
sizeof(calliterobject), /* tp_basicsize */
0, /* tp_itemsize */
/* methods */
@@ -207,7 +205,7 @@ PyTypeObject PyCallIter_Type = {
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_compare */
+ 0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -228,3 +226,5 @@ PyTypeObject PyCallIter_Type = {
(iternextfunc)calliter_iternext, /* tp_iternext */
0, /* tp_methods */
};
+
+