Working around a lack of 'goto' in python

Stephen Horne steve at ninereeds.fsnet.co.uk
Thu Mar 11 09:50:26 EST 2004


On 11 Mar 2004 12:40:42 +0100, Jacek Generowicz
<jacek.generowicz at cern.ch> wrote:

>At least one language has conditions, rather than exceptions, where
>"error" is a subtype of "condition", and where it is quite normal to
>have conditions which are not errors.

To me, a condition is a boolean expression typically written in an if
or while statement.

An exception, on the other hand, is an exception. If you want 'error'
to be a subtype of 'exception' that's fine by me, as an error is
obviously a type of exceptional circumstance. In C++ (where I'm much
more likely to write code that uses exceptions for success) I have a
base class each for error and success exceptions. Actually, I usually
don't subclass the success one as the fact that it indicates success
is usually sufficient.


-- 
Steve Horne

steve at ninereeds dot fsnet dot co dot uk



More information about the Python-list mailing list