yield: implementation details and other technica

Courageous jkraska at san.rr.com
Mon Nov 18 23:17:20 EST 2002


I have a technical problem for which grabbing the context of a generator
and *throwing* it up the stack would be preferable to the current implementation.
In the past, I've used a continuation.current() command from stackless python,
however I am possibly looking for an alternative. What I want is a giant coroutine
between a bunch of objects and a master scheduler that I control. It's not
desireable to have our users use *yield*. For one, certain high level methods
are called that imply a yield in a higher context.

Here's what I have:

	scheduler -> user code -> special code -> context yield

What are my choices?

If there aren't any, how hard would it be for me to customize the Python
interpreter to implement my semantics? (The desired semantic is to grab
the continuation of the _calling frame_, not the current frame).

Joe Kraska
San Diego CA
USA




More information about the Python-list mailing list