Kirk McDonald wrote: > Dan wrote: > > Is there some particular use in catching an exception and immediately > > re-raising it? Why catch it at all? > > All I can think of is that it changes the traceback to point to the > re-raise and not the original raise.
I've used this technique before. It is very useful where (as in the original re example) recursion might cause a large traceback, and the error is probably caused by the caller's code. Using this technique can keep the visible portion of the traceback relevant to the problem at hand. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list