[Python-ideas] The async API of the future: Twisted and Deferreds
Laurens Van Houtven
_ at lvh.cc
Sun Oct 14 18:18:52 CEST 2012
On Sun, Oct 14, 2012 at 5:53 PM, Guido van Rossum <guido at python.org> wrote:
> A readable version of this could should not have to use lambdas.
In a lot of Twisted code, it happens with methods as callback methods,
d = self._doRPC(....)
That doesn't talk about gatherResults, but hopefully it makes the idea
clear. A lot of the legibility is dependant on making those method names
sensible, though. Our in-house style guide asks for limiting functions to
about ten lines, preferably half that. Works for us.
Another pattern that's frowned upon since it's a bit of an abuse of
decorator syntax, but I still like because it tends to make things easier
to read for inline callback definitions where you do need more than a
d = somethingThatHappensLater()
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas