Hi All
I just to let you know that defer.inlineCallbacks can't work with cython
well. an example:
def await():
d = defer.Deferred()
reactor.callLater(3, d.callback, True)
return d
@defer.inlineCallbacks
def host():
thing = yield await()
""do sth"""
will fail to work on cython due to cython would change the function
name(here I refer to host()) which lead to generator can't send back the
result to the original function.
However, deferredGenerator does work with cython
like:
@defer.deferredGenerator
def host():
d = await()
thing = defer.waitForDeferred(d)
yield thing
It is not a common case to write such codes with cython, in case of need,
deferredGenerator may help.
I personally hope deferredGenerator will be always there even python 2.4
support has been abandoned. deferredGenerator itself is not so elegant as
inlineCallbacks, at least I don't need
to struggle with a series of callback functions..
Regards
gelin yan
_______________________________________________
Twisted-Python mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python