dropwhile_next(dropwhileobject *lz)
{
PyObject *item, *good;
+ PyObject *it = lz->it;
long ok;
for (;;) {
- item = PyIter_Next(lz->it);
+ assert(PyIter_Check(it));
+ item = (*it->ob_type->tp_iternext)(it);
if (item == NULL)
return NULL;
if (lz->start == 1)
takewhile_next(takewhileobject *lz)
{
PyObject *item, *good;
+ PyObject *it = lz->it;
long ok;
if (lz->stop == 1)
return NULL;
- item = PyIter_Next(lz->it);
+ assert(PyIter_Check(it));
+ item = (*it->ob_type->tp_iternext)(it);
if (item == NULL)
return NULL;
islice_next(isliceobject *lz)
{
PyObject *item;
+ PyObject *it = lz->it;
long oldnext;
while (lz->cnt < lz->next) {
- item = PyIter_Next(lz->it);
+ assert(PyIter_Check(it));
+ item = (*it->ob_type->tp_iternext)(it);
if (item == NULL)
return NULL;
Py_DECREF(item);
}
if (lz->cnt >= lz->stop)
return NULL;
- item = PyIter_Next(lz->it);
+ assert(PyIter_Check(it));
+ item = (*it->ob_type->tp_iternext)(it);
if (item == NULL)
return NULL;
lz->cnt++;
{
PyObject *args;
PyObject *result;
+ PyObject *it = lz->it;
- args = PyIter_Next(lz->it);
+ assert(PyIter_Check(it));
+ args = (*it->ob_type->tp_iternext)(it);
if (args == NULL)
return NULL;
if (!PyTuple_CheckExact(args)) {
ifilter_next(ifilterobject *lz)
{
PyObject *item;
+ PyObject *it = lz->it;
long ok;
for (;;) {
- item = PyIter_Next(lz->it);
+ assert(PyIter_Check(it));
+ item = (*it->ob_type->tp_iternext)(it);
if (item == NULL)
return NULL;
ifilterfalse_next(ifilterfalseobject *lz)
{
PyObject *item;
+ PyObject *it = lz->it;
long ok;
for (;;) {
- item = PyIter_Next(lz->it);
+ assert(PyIter_Check(it));
+ item = (*it->ob_type->tp_iternext)(it);
if (item == NULL)
return NULL;
if (result->ob_refcnt == 1) {
for (i=0 ; i < tuplesize ; i++) {
it = PyTuple_GET_ITEM(lz->ittuple, i);
- item = PyIter_Next(it);
+ assert(PyIter_Check(it));
+ item = (*it->ob_type->tp_iternext)(it);
if (item == NULL)
return NULL;
Py_DECREF(PyTuple_GET_ITEM(result, i));
return NULL;
for (i=0 ; i < tuplesize ; i++) {
it = PyTuple_GET_ITEM(lz->ittuple, i);
- item = PyIter_Next(it);
+ assert(PyIter_Check(it));
+ item = (*it->ob_type->tp_iternext)(it);
if (item == NULL) {
Py_DECREF(result);
return NULL;