RE: [Python-Dev] Exception hierarchy [was Re: Another test_compilermystery]

Aug. 17, 2004
1:11 a.m.
James Y Knight wrote:
One issue is that creating a new category of Exceptions doesn't help people who do "except:" instead of "except Exception:". It is unlikely that person meant to catch things like MemoryError, rather, they were just being lazy. I suppose that syntax could be deprecated, at least in example code and documentation, in favor of "except Exception" for the usual case, and "except Raisable" for the cases where you do actually want to catch everything*.
Personally, I would be in favour of a bare except being equivalent in new code to 'except Exception'. Although this does violate 'in the presence of ambiguity, resist the temptation to guess'. Tim Delaney
7499
Age (days ago)
7499
Last active (days ago)
0 comments
1 participants
participants (1)
-
Delaney, Timothy C (Timothy)