To use a generator as the callback just do some of the dirty work yourself. Instead of passing the callback directly, pass the generator's next() method, thus:
def handler():
for x inrange(100):
print x
yieldTrue
gobject.timeout_add(100, handler().next)
OK, it's not pretty. It would still be better for pygobject to recognize that the callback is a generator and do this automatically. But it works AFAICS.
You CAN use generators!
To use a generator as the callback just do some of the dirty work yourself. Instead of passing the callback directly, pass the generator's next() method, thus:
OK, it's not pretty. It would still be better for pygobject to recognize that the callback is a generator and do this automatically. But it works AFAICS.