[Python-Dev] quick patch for better debugging

Jeremy Fincher fincher.8 at osu.edu
Mon Nov 24 06:12:36 EST 2003


On Sunday 23 November 2003 08:05 pm, Greg Ewing wrote:
> I agree with the general idea of providing some sort of
> identifying information, but in these cases I can't think
> what sort of information would be useful short of displaying
> the entire repr() of the object, which would be too much for
> a backtrace message, I think.

You don't have to include the offending index/key in the __str__ of the 
exception itself.  Even if it was just available in the exception's args 
tuple, or even as an attribute on the exception object, it'd still be highly 
useful as a debugging tool.  I've wished for this myself on several 
occasions.

Jeremy



More information about the Python-Dev mailing list