x = codecs.charmap_build(encodings.iso8859_3.decoding_table)
check(x, size('32B2iB'))
# enumerate
- check(enumerate([]), size('n3P'))
+ check(enumerate([]), size('n4P'))
# reverse
check(reversed(''), size('nP'))
# float
typedef struct {
PyObject_HEAD
Py_ssize_t en_index; /* current index of enumeration */
- PyObject* en_sit; /* secondary iterator of enumeration */
+ PyObject* en_sit; /* secondary iterator of enumeration */
PyObject* en_result; /* result tuple */
PyObject* en_longindex; /* index for sequences >= PY_SSIZE_T_MAX */
+ PyObject* one; /* borrowed reference */
} enumobject;
Py_DECREF(en);
return NULL;
}
+ en->one = _PyLong_GetOne(); /* borrowed reference */
return (PyObject *)en;
}
}
next_index = en->en_longindex;
assert(next_index != NULL);
- stepped_up = PyNumber_Add(next_index, _PyLong_GetOne());
+ stepped_up = PyNumber_Add(next_index, en->one);
if (stepped_up == NULL) {
Py_DECREF(next_item);
return NULL;