2.5 Exceptions

Whenever code such as the following should be avoided:
try:
    some code
except:               # bad
    more code
Instead catch specific exceptions. For example,
try:
    return self.__coordinate_ring
except (AttributeError, other exceptions), msg:           # Good
    more code to compute something
Note that the syntax in the except is to list all the exceptions that are caught as a tuple, followed by the variable that holds the message.

If you don't have any exceptions explicitly listed (as a tuple), your code will catch absolutely anything, including ctrl-C and alarms, and this will lead to confusion.

See About this document... for information on suggesting changes.