[pypy-dev] Generators in RPython

Maciej Fijalkowski fijall at gmail.com
Fri Dec 23 22:40:57 CET 2011


On Fri, Dec 23, 2011 at 3:46 PM, Armin Rigo <arigo at tunes.org> wrote:
> Hi all,
>
> RPython now has support for generators.  The support is minimal for now:
>
> * only pre-Python-2.5 generators: no .send(), no "yield" inside a
> "try:finally:" block, etc.
>
> * you cannot use a "for" loop to iterate over a generator-iterator.
> You have to use explicitly .next() and catch the StopIteration, for
> now.
>
> * two different generators produce generator-iterator objects that the
> annotator cannot unify, even if they happen to yield objects of the
> same type.  You have to work around that limitation e.g. as shown in
> rpython/test/test_generator, test_cannot_merge.
>
> I still hope that this is enough to be useful to the Prolog and
> Converge interpreters :-)
>
>
> A bientôt,
>
> Armin.
> _______________________________________________
> pypy-dev mailing list
> pypy-dev at python.org
> http://mail.python.org/mailman/listinfo/pypy-dev

hooray!


More information about the pypy-dev mailing list