[Twisted-Python] Making inlineCallback return a generator

Andrew Francis andrewfr_ice at yahoo.com
Mon Jan 28 10:57:46 MST 2008


Hello Nitro:

> 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)

Thanks for the information. However there is something
you are missing. The 'something' is that one would
have to alter a particular protocol's code (the
SomeFunction) to call echo(x) in this fashion.

Cheers,
Andrew






      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs




More information about the Twisted-Python mailing list