7 Sep
2004
7 Sep
'04
3:11 p.m.
Barry Warsaw wrote:
I don't agree about having exceptions that pass bare excepts. A typical /valid/ use of bare excepts are in frameworks such as transaction processing, where you need to do some extra work when an exception occurs, then re-raise the original exception, [...]
My policy for bare excepts is that without significant justification they _must_ either re-raise the original exception or raise another exception. There are very few circumstances where I have allowed my team to write pure bare excepts. I haven't checked, but a warning for violations of this rule may be a nice addition to pychecker or pylint. -Kevin