[Patches] Patch: AttributeError and NameError: second attempt.

Guido van Rossum guido@python.org
Fri, 26 May 2000 08:31:06 -0500


> Note that you'll only print the exception in interactive sessions
> or when writing it to log files. In both cases, performance is
> not relevant, but information quality is. Only having the object
> around doesn't always help, because there may be more context
> needed in order to find the bug. The locals printout I'm using
> has helped me quite a few times and is a great development
> tool.

Sorry for the barrage of messages showing me thinking aloud.  I'm
beginning to realize what makes me feel uneasy with Nick's approach.
This kind of user-friendliness should really be in the tools, not in
the core language implementation!  And the friendliness should only be
paid for when a traceback is printed.

For example, IDLE prints its own traceback.  It has the stack frame
available too (via sys.exc_traceback).  It could easily detect a
NameError or AttributeError and do the various checks for misspelled
identifiers.  This is where it should be fixed.  (In fact, it should
be made available in general e.g. through the traceback module so it
can also be added to other IDEs like Pythonwin or ActivePython.)

--Guido van Rossum (home page: http://www.python.org/~guido/)