Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#5399 enhancement closed fixed (fixed)

add documentation about the return value of addCallbacks and friends

Reported by: zooko Owned by: jesstess
Priority: normal Milestone:
Component: core Keywords: doc
Cc: Thijs Triemstra, jesstess Branch: branches/addcallbacks-ret-5399
branch-diff, diff-cov, branch-cov, buildbot
Author: zooko

Description (last modified by Thijs Triemstra)

I needed to know this and I ended up having to read the source code to learn it. This patch will let the next person learn it from docstrings.

  • twisted/internet/defer.py

    === modified file 'twisted/internet/defer.py'
     
    276276        Add a pair of callbacks (success and error) to this L{Deferred}.
    277277
    278278        These will be executed when the 'master' callback is run.
     279
     280        Returns self.
    279281        """
    280282        assert callable(callback)
    281283        assert errback == None or callable(errback)
     
    341343        being returned from a callback, it is possible to cause the call
    342344        stack size limit to be exceeded by chaining many L{Deferred}s
    343345        together with C{chainDeferred}.
     346
     347        Returns self.
    344348        """
    345349        d._chainedTo = self
    346350        return self.addCallbacks(d.callback, d.errback)

(I'll also attach this patch as a unified diff file.)

Attachments (1)

doc-retval-of-addCallbacks.diff.txt (782 bytes) - added by zooko 8 years ago.

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by zooko

comment:1 Changed 8 years ago by Thijs Triemstra

Cc: Thijs Triemstra added
Description: modified (diff)

comment:2 Changed 8 years ago by Jean-Paul Calderone

Keywords: review added

comment:3 Changed 8 years ago by jesstess

Cc: jesstess added
Owner: set to jesstess

comment:4 Changed 8 years ago by jesstess

Author: jesstess
Branch: branches/addcallbacks-ret-5399

(In [33277]) Branching to 'addcallbacks-ret-5399'

comment:5 Changed 8 years ago by jesstess

(In [33278]) Apply doc-retval-of-addCallbacks.diff.txt by zooko.

refs #5399

comment:6 Changed 8 years ago by jesstess

Resolution: fixed
Status: newclosed

(In [33281]) Merge addcallbacks-ret-5399

Author: zooko Reviewer: jesstess Fixes: #5399

Document the return values of addCallbacks and chainDeferred in twisted.internet.defer.Deferred.

comment:7 Changed 8 years ago by jesstess

Author: jesstesszooko
Keywords: review removed

Thanks for the ticket and patch, zooko!

I added some epytext markup before merging.

Doc builder results.

(As usual, I failed to move this out of review before closing)

Note: See TracTickets for help on using tickets.