[Twisted-Python] My pet peeve ugly coding style

Jp Calderone exarkun at twistedmatrix.com
Thu Jul 10 23:27:49 MDT 2003


On Thu, Jul 10, 2003 at 08:27:10PM -0400, Steve Waterbury wrote:
> Glyph Lefkowitz wrote:
> >On Thursday, July 10, 2003, at 02:17 PM, Tommi Virtanen wrote:
> [snip]
> 
> >  return foo (
> >    ).addCallback(bar
> >    ).addCallback(baz
> >    ) # ...
> 
> IMHO, that's still ugly.
> 
> >If the proper placement of parentheses is a particular problem for you, 
> >consider
> >
> >  return (foo()
> >          .addCallback(bar)
> >          .addCallback(baz)
> >          .addCallback(boz))
> >
> [snip]

    reduce(Deferred.addCallback, (bar, baz, boz), foo())

> Whatever.  "De gustibus non est disputandum."
> 
> Steve.
> 

  Jp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: </pipermail/twisted-python/attachments/20030711/3503a07b/attachment.sig>


More information about the Twisted-Python mailing list