mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Patch #427190: Implement and use METH_NOARGS and METH_O.
This commit is contained in:
parent
c35422109b
commit
e3eb1f2b23
17 changed files with 429 additions and 551 deletions
|
@ -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 */
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue