Oon-Ee Ng <[email protected]> writes:
> The closest I'm able to come to that so far is for my function to be
> decorated with @defer.inlineCallbacks which will then look like this
>
> val = yield doSomeCallRemoteCallHere(args)
> myWidget.text = val
You can even do "myWidget.text = yield somethingDeferred()"
> Is this as 'good' (for the subjective readability concern) as it gets?
Yes.
Unless you move everything to Python 3 and then you can use the async /
await syntax (with Twisted), which is more-or-less the same as the above
(but you avoid the decorator). It would look like:
myWidget.text = await somethingDeferred()
--
meejah
_______________________________________________
Twisted-Python mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python