[Cython] Recent bugs in generators

Stefan Behnel stefan_ml at behnel.de
Tue Apr 19 07:17:45 CEST 2011


Vitja Makarov, 18.04.2011 15:19:
> There is one more interesting thing:
>
> def test_yield_inside_genexp():
>      """
>      >>>  o = test_yield_inside_genexp()
>      >>>  list(o)
>      [0, None, 1, None, 2, None]
>      """
>      return ((yield i) for i in range(3))

Impressively ugly.

I guess we should start testing these things with other Python 
implementations than CPython, in order to see if these corner cases are 
really being accepted and knowingly being implemented, or if it's just 
something that no-one has really cared about so far and that's actually 
worth discussing.

Stefan


More information about the cython-devel mailing list