Code review comment for lp:~allenap/launchpad/twisted-threading-bug-491870

Revision history for this message
Jonathan Lange (jml) wrote :

On Mon, Feb 8, 2010 at 5:38 PM, Henning Eggers
<email address hidden> wrote:
> Review: Approve code
> Thanks for this improvement!
>
> We talked about some things on IRC:
> - Use of lambda is against LP coding style but common in Twisted. We will raise the issue at the reviewers meeting and you can leave it as it is for now. If the style change gets rejected, I ask you to fix this in a follow-up branch. Or wait until after the meeting before landing.

FWIW, if the reviewers decree that lambda is too hard to read, then
it's probably worth defining a function like this:

  def kerchop(f):
    def callback(ignored, *args, **kwargs):
      return f(*args, **kwargs)
    return mergeFunctionMetadata(f, callback)

And then replacing:
  d.addCallback(lambda ignored: reactor.stop())

with:
  d.addCallback(kerchop(reactor.stop))

The function ought to go somewhere in lp.services, and have a better
name than 'kerchop'.

jml

« Back to merge proposal