exceptions

Alex Martelli aleaxit at yahoo.com
Thu Oct 5 16:04:02 EDT 2000


"Aleksei Guzev" <aleksei.guzev at bigfoot.com> wrote in message
news:mailman.970765210.27834.python-list at python.org...
> Why Python has exceptions of the only type? Take CLU. It supports
exceptions
> and signals. The difference is what happens upon completing an exception
or
> a signal handling code. In the latter case the execution returns to the
next
> statement after one wich throwed the signal. For instance one can
encounter
    [snip]
> P.S. In FoxPro the execution may continue to the next statement after
> handling block, or it may continue to the next statement to one which
> throwed the exception, or it may repeat the <errorneous> statement after
the
> handling block.

Restartable exceptions were a very popular idea in certain old languages
(besides CLU and FoxPro, you may also find a trace of them in Visual
Basic, Win/NT's SEH...).  Experience showed they were not worth the
huge bother.  Stroustrup explains it very well in "Design and Evolution of
the C++ Programming Language" -- he had the advantage of advice from
users of previous exception-supporting languages (such as MESA, I
believe) about this issue, and took it to heart.

As has already been pointed out, just try/except around the very statement
that may fail, and you don't need to complicate your language with various
kinds of exceptions (restartable/non-restartable/etc...).


Alex







More information about the Python-list mailing list