I was taking a look at the hierarchy of the built-in python exceptions, and I noticed that `StopIteration` and `GeneratorExit` have different base classes:

```
BaseException
 +-- SystemExit
 +-- KeyboardInterrupt
 +-- GeneratorExit
 +-- Exception
      +-- StopIteration
      +-- StandardError
      +-- Warning

```

Or in code:

```
>>> GeneratorExit.__bases__
(<type 'exceptions.BaseException'>,)
>>> StopIteration.__bases__
(<type 'exceptions.Exception'>,)

```

When I go to the specific description of each exception, I can read following:

<https://docs.python.org/2/library/exceptions.html#exceptions.GeneratorExit>

> 
> exception GeneratorExit
> 
> 
> Raised when a generator‘s close() method is called. It directly inherits from BaseException instead of StandardError since it is technically not an error.
> 
> 
> 

<https://docs.python.org/2/library/exceptions.html#exceptions.StopIteration>

> 
> exception StopIteration
> 
> 
> Raised by an iterator‘s next() method to signal that there are no further values. This is derived from Exception rather than StandardError, since this is not considered an error in its normal application.
> 
> 
> 

Which is not very clear to me. Both are similar in the sense that they do not notify errors, but an "event" to change the flow of the code. So, they are not technically errors, and I understand that they should be separated from the rest of the exceptions... but why is one a subclass of `BaseException` and the other one a subclass of `Exception`?.

In general I considered always that `Exception` subclasses are errors, and when I write a blind `try: except:` (for instance calling third party code), I always tried to catch `Exception`, but maybe that is wrong and I should be catching `StandardError`.