Iterating generator from C

Christian Tismer tismer at
Mon May 15 17:35:34 CEST 2006

Sven Suursoho wrote:

>>>  Is there any way to rewrite following program to handle returned 
>>> generator  without hitting this bug?

The only way I can think of getting around this is to make
sure that there is always a running python frame.
This would be possible if you can control how the
extension is called.

> Unfortunately, this is not an option because I can't control used 
> environment: I'm trying to improve PostgreSQL's stored procedure 
> language PL/Python and this software can be used everywhere.

Then there is no other way than to report the bug, get the
fix back-ported and nagging the PL/Python maintainers
to update things after the fix.
Also a test should be added which is probably missing since a while.

I'd put a warning somewhere that generators are broken in
debug mode, file an issue as well, but avoid trying to hack
around this. It would make the bug even more resistent :-)

ciao - chris
Christian Tismer             :^)   <mailto:tismer at>
tismerysoft GmbH             :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9A     :    *Starship*
14109 Berlin                 :     PGP key ->
work +49 30 802 86 56  mobile +49 173 24 18 776  fax +49 30 80 90 57 05
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
      whom do you want to sponsor today?

More information about the Python-list mailing list