Message177158
| Author |
ncoghlan |
| Recipients |
Arfrever, Tyler.Crompton, ethan.furman, georg.brandl, ncoghlan, python-dev |
| Date |
2012年12月08日.12:27:29 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1354969650.24.0.954338949246.issue15209@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|