Exception Handling in Python 3

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Oct 29 19:14:07 EDT 2010


Chris Rebert wrote:
> On Fri, Oct 29, 2010 at 2:30 AM, Gregory Ewing
> <greg.ewing at canterbury.ac.nz> wrote:

>>I think what's disturbing about this is that the two halves of
>>the extended traceback are printed in the wrong order. We're

> True, but swapping the order would only worsen Steve's problem.

Yes, I can see that what Steve's problem requires is a way
of explicitly saying "replace the current exception" without
attaching any context.

However, in the case where the replacement is accidental,
I think it would make more sense to display them in the
opposite order. Both of the exceptions represent bugs in
that situation, so you will want to address them both, and
you might as well get the traceback in a non-confusing order.

-- 
Greg



More information about the Python-list mailing list