[Stackless] converting callbacks into an iterator

Andrew Dalke dalke at dalkescientific.com
Thu Nov 9 00:18:02 CET 2006


I've written up an example of converting SAX handler
callbacks into an iterator stream

http://www.dalkescientific.com/writings/diary/archive/2006/11/06/ 
iterparse_filter.html#stackless

Simple and straight-forward, and ...

Jeff Rush:
> Oh and be prepared to answer certain expected questions.  I'm now  
> hearing
> people say that Stackless is irrelevant now, with the release of  
> Python 2.5.
> The additional of bidirectional generations (yield as an expression  
> instead of
> a statement) means we can do lightweight cotasking without the use of
> Stackless.  I'm sure there is more to it, but that is the talk on the  
> street
> that needs to be addressed.

... it's an example of how bidi yield expressions aren't
quite good enough.  They only yield to the calling context,
which is inside an XML processor that doesn't further yield
the context to *its* caller.

Oh, and it includes passing the exception information through
the channel so it's raised in the caller's context.


					Andrew
					dalke at dalkescientific.com


_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless



More information about the Stackless mailing list