[pygtk] gobject.idle_add and generators

Greg Ewing greg.ewing at canterbury.ac.nz
Sat May 3 08:36:38 WST 2008


skip at pobox.com wrote:

>     def g():
>         while True:
>             do_something_useful()
>             yield True
> 
> Does it make sense to call it like this?
> 
>     gobject.idle_add(g)

No, but it might make sense to use it like this:

   gobject.idle_add(g().next)

-- 
Greg


More information about the pygtk mailing list