[issue15209] Re-raising exceptions from an expression

Nick Coghlan report at bugs.python.org
Sat Dec 8 13:27:30 CET 2012


Nick Coghlan added the comment:

I rewrote the relevant section of the module docs (since they were a bit murky in other ways as well).

Since I didn't answer the question earlier, the main reason a bare raise is permitted is because it's designed to be used to a bare except clause (e.g. when rolling back a database transaction as a result of an error). While you could achieve the same thing now with "except BaseException", the requirement for all exceptions to inherit from BaseException is relatively recent - back in the days of string exceptions there was simply no way to catch arbitrary exceptions *and* give them a name.

----------
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15209>
_______________________________________


More information about the Python-bugs-list mailing list