[Twisted-Python] Why twisted.internet.error.TimeoutError and twisted.internet.defer.TimeoutError?
andrew-twisted at puzzling.org
Thu Feb 12 07:25:19 EST 2004
On Thu, Feb 12, 2004 at 07:07:24AM -0500, Mike C. Fletcher wrote:
> I realise there's arguments that you want to be able to distinguish
> between the two, so having a DeferredTimeoutError and a regular
> TimeoutError would make sense, but it would still seem that you'd want
> them to have a common base-class that lets you catch them together.
I suppose the reason is that no-one thought about it very much :)
IIRC, defer.TimeoutError (and the setTimeout method of Deferred) was
originally added by me, and I guess I erred on the side of caution. Aside
from setTimeout, there's nothing in defer.py that depends on anything else
in the twisted.internet package, and I was probably trying to avoid making
the dependency on twisted.internet any larger than it needed to be...
I'd have no problems with a common base class, although I think I'd lean
towards just using TimeoutError directly from twisted.internet.error. Does
anyone else have an opinion?
More information about the Twisted-Python