December 2000
Intermediate to advanced
816 pages
16h 57m
English
As we mentioned above, as of Python 1.5, all standard exceptions are now identified using classes. User-defined, class-based exceptions have been around for longer than that (since Python 1.2!), but until 1.5, the standard exceptions remained implemented as strings, mostly for backwards compatibility. However, there are a number of advantages that classes bring to the table, and these reasons were what finally led to all standard exceptions being converted from strings to class-based.
The search for an exception handler (checking each except clause) is accomplished via object identity and not object value. That means that if you are using string exceptions, the string object ...
Read now
Unlock full access