Beispiel #1
0
PyObject *
DiffIter_iternext(DiffIter *self)
{
    if (self->i < self->n)
        return diff_get_patch_byindex(self->diff->list, self->i++);

    PyErr_SetNone(PyExc_StopIteration);
    return NULL;
}
Beispiel #2
0
PyObject *
Diff_getitem(Diff *self, PyObject *value)
{
    size_t i;

    if (!PyLong_Check(value))
        return NULL;

    i = PyLong_AsUnsignedLong(value);
    return diff_get_patch_byindex(self->diff, i);
}