From: Mark Wooding Date: Wed, 15 Mar 2006 01:23:15 +0000 (+0000) Subject: mapping: Make the iterators conform to the proper interface. X-Git-Tag: 1.0.1~18 X-Git-Url: https://git.distorted.org.uk/~mdw/mLib-python/commitdiff_plain/f9f0b46e136ffa44d80c0a183ac99a9fce78d357?hp=26d9d0fb1d0ab596657f968425318456e45ea660 mapping: Make the iterators conform to the proper interface. An iterator must implement __iter__() as an identity operation. Make it so. --- diff --git a/mapping.pyx b/mapping.pyx index aa5de85..ab637c3 100644 --- a/mapping.pyx +++ b/mapping.pyx @@ -172,6 +172,8 @@ cdef class MapIterBase: def __new__(me): me.i = m._iter() me._init() + def __iter__(me): + return me def __next__(me): cdef void *e e = me.i._next()