Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Java solved the problem by having Throwable as the root of all exceptions and not advertising that fact loudly. The derived Exception class is the root of all safely catchable exceptions. When someone catches a Throwable, something strange is going on.


Python does the same thing. It just calls Throwable something different.

Java Throwable ~= Python BaseException.

Java Exception ~= Python Exception.

The problem here is that a bare except catches something similar to Throwable, not something similar to Exception.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: