On Tue, Oct 4, 2016 at 12:42 PM, meejah <mee...@meejah.ca> wrote: > Oon-Ee Ng <ngoonee.t...@gmail.com> 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()"
Why yes, that makes sense. > >> 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() > I would if I could, most of my projects are already there but last I checked (beginning of the year) the _threadedselect reactor wasn't fully ready yet, and AMP wasn't ported. I see a lot of progress on that front with Amber's frequent updates here, so will migrate when I can, but in the meantime I'm keeping things on python2 (no official release of the app yet, so its not a big deal to shift when ready). _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python