🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #2904

Re: Which to use :- Perl, Python, Icon, ... ?

#2904
From: Guido van Rossum
Date: Wed, 06 Mar 1991 14:19
41 lines
2206 bytes
brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:

>>   + Does it have a debugger?  If not, are there any extra facilities
>>     for debuggging above and beyond simply inserting `printf' (change
>>     as appropriate) statements.

>Perl does. I haven't seen one for Icon, and I'm not yet familiar enough
>with the Python package.

Python currently has some debugging support: when an unhandled
exception occurs, it prints a stack backtrace showing source code
lines.  (The backtrace is arguably upside-down, but then most stacks
are...)

Interactively, you can then use a traceback module (not yet
documented, but supplied with the distribution: lib/tb.py) which
allows you to inspect the stack frames: print local and global
variables, and even execute statements in the context of a given stack
frame.

There is also a disassembly module for the bytecode used by the
Python interpreter (lib/dis.py).

There is no single-step or breakpoint facility, but it should not be
hard to implement this in the Python interpreter -- I may do so in the
next release.  (You can force a dump at a particular place by writing
"raise SystemError", but you can't continue yet.)

There is rudimentary support for reloading modules after you've
editing them without leaving the interpreter, but there are problems
that I haven't fully solved yet: you may or may not have to re-execute
the initialization code of other modules that reference the reloaded
module, depending on what use the other module makes of the reloaded
module.

But actually, I do most of my debugging by inserting print statements
in the rare cases where the stack backtrace doesn't immediately show
what went wrong.

--Guido van Rossum, CWI, Amsterdam <guido@cwi.nl>
"It's probably pining for the fiords"
Technical Details
Message-ID: <3122@charon.cwi.nl>
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!charon!guido
References: <BEVAN.91Mar5123224@tiger.cs.man.ac.uk> <8865:Mar611:05:4091@kramden.acf.nyu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!charon!guido
From: guido@cwi.nl (Guido van Rossum)
Newsgroups: comp.lang.misc
Subject: Re: Which to use :- Perl, Python, Icon, ... ?
Message-ID: <3122@charon.cwi.nl>
Date: 6 Mar 91 14:19:33 GMT
References: <BEVAN.91Mar5123224@tiger.cs.man.ac.uk> <8865:Mar611:05:4091@kramden.acf.nyu.edu>
Sender: news@cwi.nl
Lines: 41