[Twisted-Python] tee method in twisted.internet.defer.py ?

Terry Jones terry at jon.es
Tue Nov 17 10:33:06 EST 2009

Is there a reason why the Deferred class doesn't have a tee method like the
following (untested)?

    def tee(self, d):
        def _cb(arg):
            return arg

        def _eb(arg):
            return arg

        return self.addCallbacks(_cb, _eb)

I suppose it could be called teeDeferred to correspond to chainDeferred.
And I guess it's clear what it does and why it's quite different from
chainDeferred. I at least would find it quite useful.


More information about the Twisted-Python mailing list