Evaluating python - a question

David Bolen db3l at fitlinxx.com
Fri May 18 14:20:20 EDT 2001


tanzer at swing.co.at (Christian Tanzer) writes:

> The problem are typos that are triggered rarely (e.g., in an exception
> handler) -- you may correct the typo in 1 minute but your customer
> might not be amused by seeing a stacktrace.
> 
> As others already pointed out, unit-tests are the answer (and will
> catch a lot more bugs than static type checking, too).

In addition to unit tests, the fact that in production code you can
establish an exception handler of last resort (or multiple
intermediate such handlers) to record all traceback information (and
with introspection, perhaps a bunch of your internal state), and then
attempt a graceful recovery from a high level is very useful.

Sure, sometimes you have to start over at a high enough level that
something is lost for the user, but there's really normally no reason
for the user to have to see a stacktrace - but if they send you the
diagnostic dump you can get an immediate pinpoint to the problem area.

Hmm, I wonder if anyone has tried building such a handler that would
dump an entire application state to a file - an internal
Python-specific "core dump" if you will.  I normally just log
tracebacks and have found that sufficient but it's an interesting
thought.

--
-- David
-- 
/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l at fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/



More information about the Python-list mailing list