[Python-Dev] Traceback style

Ka-Ping Yee ping@lfw.org
Tue, 2 May 2000 03:23:26 -0700 (PDT)

On Tue, 2 May 2000, Eric S. Raymond wrote:
> Ka-Ping Yee <ping@lfw.org>:
> > 
> > With the suggested changes, this would print as
> > 
> >     Traceback (innermost last):
> >       Line 1 of <stdin>
> >       Line 3 of <stdin>, in Spam.eggs
> >     AttributeError: ham
> IMHO, this is not a good idea.  Emacs users like me want traceback
> labels to be *more* like C compiler error messages, not less.

I suppose Python could go all the way and say things like

    Traceback (innermost last):
      foo.py:25: in Spam.eggs
    AttributeError: ham

but that might be more intimidating for a beginner.

Besides, you Emacs guys have plenty of programmability anyway :)
You would have to do a little parsing to get the file name and
line number from the current format; it's no more work to get
it from the suggested format.

(What i would really like, by the way, is to see the values of
the function arguments on the stack -- but that's a lot of work
to do in C, so implementing this with the help of repr.repr
will probably be the first thing i do with sys.displaytb.)

-- ?!ng