PyWart: NameError trackbacks are superfluous

Chris Angelico rosuav at
Sun Mar 17 00:59:17 CET 2013

On Sun, Mar 17, 2013 at 10:48 AM, Steven D'Aprano
<steve+comp.lang.python at> wrote:
> Here's a truly trivial case where code will succeed or fail depending on
> the order of function calls.
> (chop code)
> It's not enough to know that the print line in display() fails, because
> that's merely the side-effect. The actual problem occurs in the caller,
> fail(). If NameError suppressed the traceback, that would be more
> difficult to solve.

A good example. It would be logically equivalent to set spam=None in
stop(), and nobody would expect the TypeError to omit the traceback,
so why should delling the name be any different?


More information about the Python-list mailing list