using generators for event handling in python. (simpler version)
Robin Bryce
robin at wiretooth.com
Fri Sep 3 00:27:39 EDT 2004
I removed the generalised exception passing and just deal with values
and StopIteration now. fork is gone but the behaviour is not. I've
chopped down the discussion a lot and removed the twisted examples. Also
made an effort to make the source more readable.
I had a think about what I was doing and why. I think what I'm saying is
that I want to pass values into a generator and leave it to that
generator to decide how to update its local attributes (its state) if at
all. I definitely need to carefully re-read:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/164044
This is the version with the above changes.
http://www.wiretooth.com/python/eventhub/valuehub_recipe.html
Still trying to think of tighter example that sums everything up.
Thanks,
Robin Bryce
On Thu, 2004-09-02 at 22:26, Raymond Hettinger wrote:
> > I've been looking at generators from the context of event oriented web
> > application development. I was thinking of submitting a version of
> > http://www.wiretooth.com/eventhub_recipe.html as a recipe for the python
> > cookbook.
>
> It's somewhat long for a recipe. Do you have more compact code that conveys the
> essense of your approach?
>
>
> Raymond Hettinger
>
More information about the Python-list
mailing list