[Twisted-Python] Making inlineCallback return a generator

Nitro nitro at dr-code.org
Sun Jan 27 18:29:45 EST 2008


> def SomeFunction(x):
>     .
>     .
>     result = echo(x)
>     .
>     .
>     .

Maybe I am missing something or we're going in circles, but how about

@inlineCallbacks
def SomeFunction(x):
     result = yield echo(x)

You should not use inlineCallbacks on echo itself. You need to use it on  
the function that calls echo. That's a difference.

-Matthias




More information about the Twisted-Python mailing list