Re: Python or Perl for a Debian maintainance project?
On Thu, Feb 19, 2004 at 08:35:05PM +0000, Andrew Suffield wrote:
> The only way to get shorter is to not handle the errors - which is the
> norm in python.
It's no different than Perl.
foo or die "Bad thing happened!"
in Perl gives you the same effect as not handling the exception in
Python. Actually, Python's *default* error will be more useful that
most *coded* errors in Perl since Python includes not only the type of
error (in the form of the exception object), but also the errors
description, thread in which it occured (with a name, if the thread was
named), and full stack trace.
Also, lots of code -- both Perl and C -- does not even check for errors
at all. It is extremely commonplace to see calls to write() that never
check for errors in C, or calls to printf or print or whatever your
output function is. In my book, that's worse.
There is no such thing as an I/O operation without an error check in
Python, and in my book, that is an incredibly Good Thing.