[Python-Dev] Re: Dangerous exceptions (was Re: Another test_compilermystery)

Kevin Jacobs jacobs at theopalgroup.com
Tue Sep 7 17:11:57 CEST 2004


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



More information about the Python-Dev mailing list