Why are Python exceptions named “Error”?

  1. You don’t name each class with ‘Class’ in name and each variable with ‘_variable’ in name. The same way you don’t name exception using the word ‘Exception’. A name should say something about the meaning of an object. ‘Error’ is the meaning of most exceptions.

  2. Not all Exceptions are Errors. SystemExit, KeyboardInterrupt, StopIteration, GeneratorExit are all exceptions and not errors. The word ‘Error’ in actual errors shows the difference.

  3. ‘Error’ is shorter than ‘Exception’. That can save a few characters in the code width with no loss in meaning. That makes some difference.

Leave a Comment

tech