turning callback into generator

Peter Otten __peter__ at web.de
Mon Sep 6 23:24:17 CEST 2004

Wai Yip Tung wrote:

> I'm attempting to turn some process than uses callback to return result
> into a more user friendly generator. I'm hitting some road block so any
> pointer would be appriciated.

I asked the same question a while back and there were no satisfying


At the very least you need threads, and when the generator is not fully
exhausted it's easy to end up with a thread waiting forever. 

I finally dropped the idea, but if you are really determined and want to
hack something together, the following might (or might not, this is really
a shot in the dark) serve as a starting point:



More information about the Python-list mailing list