stackless python

Neil Schemenauer nas at python.ca
Mon Jul 8 15:45:40 EDT 2002


François Pinard wrote:
> (My main question, maybe already answered in there -- I did not check yet
> -- is how one proceeds to `yield' from within a nest of function calls,
> and to later kludge resuming the function nesting sequence on `.next()'.)

You can't since only one stack frame is saved per generator.  That's why
one of the reasons they are called simple generators (two others being
ease of implementation and of understanding).  You probably want to look
at stackless Python if you haven't already.

> P.S. - Smiley mode on.  I read "tow" in the quote above and surely, this
> is a typo.  But I wonder if it is a typo of "two" or a typo of "toy". :-)

Either correction works fine.

  Neil





More information about the Python-list mailing list