On 8/24/05, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> Hey guys, don't give up your bare except clauses so easily.
They are an attractive nuisance by being so much shorter to type than
the "right thing to do".
Especially if they default to something whose use cases are rather
esoteric (i.e. B
Raymond Hettinger wrote:
> Hey guys, don't give up your bare except clauses so easily.
Yes, Don't give up. I often write code starting with a bare except,
then after it works, stick a raise in it to determine exactly what
exception I'm catching. Then use that to rewrite a more explicit except
Raymond writes:
> Hey guys, don't give up your bare except clauses so easily.
[...]
Raymond:
I agree that when comparing:
// Code snippet A
try:
...
except SomeException:
...
except BaseException:
...
with
// Code snippet B
try:
...
except
Hey guys, don't give up your bare except clauses so easily.
They are useful. And, if given the natural meaning of "catch
everything" and put in a natural position at the end of a suite, their
meaning is plain and obvious. Remember beauty counts. I don't think
there would be similar temptation t