[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Python or Perl for a Debian maintainance project?

On Thu, Feb 19, 2004 at 10:42:56AM +0800, Isaac To wrote:
> It is *full* of goto.  Those who are used to writing application code will
> find it is all too tempted to simply "return" at the point of error, and
> learn bitterly that the lock they are holding is not unlocked, leaving them
> a dead kernel.  It is possible to write something like this

I had sworn I wouldn't join this thread... <sigh>

This cas is handled very cleanly by python's try...finally construct,
which take care of calling the cleanup code in *all* cases, even the
one you'd have forgotten. 

The exception mechanism in any language is not about displaying a
traceback to the user (and Joey, please do file bugs against any package
which does so, in the same way you'd file bugs against programs dumping
cores), it is about separating the normal flow of event from the error
flow, and enabling corrective actions to take place where it makes sense
to put them.

Alexandre Fayolle                              LOGILAB, Paris (France).
http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org

Attachment: signature.asc
Description: Digital signature

Reply to: