title: Catching exceptions based on their abstract base class
body: <p>Suppose I've got an exception class with an abstract base class, something like this:</p>
  
  <pre><code>class MyExceptions(BaseExeption, metaclass=abc.ABCMeta):
      pass
  
  class ProperSubclass(MyExceptions):
      pass
  
  MyExceptions.register(ValueError)
  </code></pre>
  
  <p>It appears that I can catch <code>ProperSubclass</code> by <code>MyExceptions</code>, but not <code>ValueError</code>:</p>
  
  <pre><code>try:
      raise ProperSubclass()
  except MyExceptions:
      print('As expected, control comes here...')
  except:
      print('...and not here.')
  
  try:
      raise ValueError()
  except MyExceptions:
      print('Control does not come here...')
  except ValueError:
      print('...but unexpectedly comes here.')
  </code></pre>
  
  <p>So my question is, should I be able to catch built-in exceptions by their abstract base class? If so, how? And if not, what are the rules? </p>
  
  <p>I guess another way of asking this is: do except clauses properly use isinstance()/issubclass() for matching, and if not (as appears to be the case) what <em>do</em> they use? Perhaps there are some shady shortcuts down in the C implementation.</p>