Stackless Python and Python 2.x

Michael Abbott Michael at RCP.co.uk
Wed Sep 5 10:34:10 EDT 2001


Skip Montanaro (skip at pobox.com):
> I believe simple generators can only yield back to their caller, so all
> that's necessary (in my simple-minded view of things) is to retain a
> reference to the stack frame when yield is executed and not reinitialize
the
> stack frame the next time the generator is called.

I'm pretty sure that doesn't work for generators, because I suspect that
part of the point of their simplified implementation is that only one stack
frame is required.  In particular, this probably means that the generator's
stack frame has to be "torn down" each time the generator yields back to its
caller.




More information about the Python-list mailing list