On Sat, Jan 30, 2010 at 2:16 AM, Andrew Bennetts <and...@bemusement.org> wrote: > twisted-...@udmvt.ru wrote: > [...] >> Is it true, that adding many callback functions as filters is elegant, >> but impractical solution? >> Since there is only a [linear] list of pairs (callback, errback), the last >> errbacks >> have to be complex to distinguish the failures, that came from the previous >> callback >> from failures, that traverse the errback chain from the beginning. > > This is no different to regular Python code, which has a linear call stack > which > can have exception handlers at any point on the stack. The exact same > tradeoffs > apply about which exceptions to raise and which to catch, and at what points. > > -Andrew. >
In normal python code you might put each filter into a try/except block, wouldn't this be equivalent to putting a callback and errback (addCallbacks) each time you are adding a callback. So that the errback would then know which callback (the previous one) failed. _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python