Patch #427190: Implement and use METH_NOARGS and METH_O.

This commit is contained in:
Martin v. Löwis 2001-08-16 13:15:00 +00:00
parent c35422109b
commit e3eb1f2b23
17 changed files with 429 additions and 551 deletions

View file

@ -37,7 +37,7 @@ iter_traverse(seqiterobject *it, visitproc visit, void *arg)
}
static PyObject *
iter_next(seqiterobject *it, PyObject *args)
iter_next(seqiterobject *it)
{
PyObject *seq = it->it_seq;
PyObject *result = PySequence_GetItem(seq, it->it_index++);
@ -91,7 +91,7 @@ iter_iternext(PyObject *iterator)
}
static PyMethodDef iter_methods[] = {
{"next", (PyCFunction)iter_next, METH_VARARGS,
{"next", (PyCFunction)iter_next, METH_NOARGS,
"it.next() -- get the next value, or raise StopIteration"},
{NULL, NULL} /* sentinel */
};