More on exceptions
User-defined exceptions
- subclass Exception or any other standard exception
Old Python: exceptions can be strings
- WATCH OUT: compared by object identity, not ==
Last caught exception info:
- sys.exc_info() == (exc_type, exc_value, exc_traceback)
Last uncaught exception (traceback printed):
- sys.last_type, sys.last_value, sys.last_traceback
Printing exceptions: traceback module