[Python-Dev] Simple generators, round 2

Christian Tismer tismer@tismer.com
Mon, 19 Mar 2001 17:58:46 +0100


Neil Schemenauer wrote:
...
> > 2) Do not expose the resume and suspend methods to the
> >    Python user, and recode Generator.py as an extension
> >    module in C. This should prevent abuse of frames.
> 
> I like the frame methods.  However, this may be a good idea since
> Jython may implement things quite differently.

Maybe a good reason. Exposing frame methods is nice
to play with. Finally, you will want the hard coded
generators. The same thing is happening with Stackless
now. I have a different spelling for frames :-) but
they have to vanish now.

[immature pre-pre-pre-interface]
> The interface needs some work and I'm happy to change it to
> better accommodate stackless.  f_suspendvalue and f_stackbottom
> are pretty ugly, IMO.  One unexpected benefit: with
> PyEval_EvalFrame split out of eval_code2 the interpreter is 5%
> faster on my machine.  I suspect the compiler has an easier time
> optimizing the loop in the smaller function.

Really!? I thought you told about a speed loss?

> BTW, where is this stackless light patch I've been hearing about?
> I would be interested to look at it.  Thanks for your comments.

It does not exist at all. It is just an idea, and
were are looking for somebody who can implement it.
At the moment, we have a PEP (thanks to Gordon), but
there is no specification of StackLite.
I believe PEPs are a good idea.
In this special case, I'd recomment to try to write
a StackLite, and then write the PEP :-)

ciao - chris

-- 
Christian Tismer             :^)   <mailto:tismer@tismer.com>
Mission Impossible 5oftware  :     Have a break! Take a ride on Python's
Kaunstr. 26                  :    *Starship* http://starship.python.net/
14163 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     where do you want to jump today?   http://www.stackless.com/