title: Why doesn't Python's `except` use `isinstance`?
body: <p>The <a href="http://docs.python.org/reference/compound_stmts.html#the-try-statement" rel="noreferrer">Python documentation</a> for <code>except</code> says:</p>
  
  <blockquote>
    <p>For an except clause with an
    expression, that expression is
    evaluated, and the clause matches the
    exception if the resulting object is
    “compatible” with the exception. An
    object is compatible with an exception
    if <strong>it is the class or a base class of the exception object</strong>, [...]</p>
  </blockquote>
  
  <p>Why doesn't <code>except</code> use <code>isinstance</code> instead of comparing base classes? This is preventing the use of <code>__instancecheck__</code> to override the instance check.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I can understand that one of the reasons this doesn't exist is that no one considered it. But are there any reasons why this should not be implemented?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Shell session from Python 3.2a showing that trying to use <code>__subclasscheck__</code> for this doesn't work:</p>
  
  <pre><code>&gt;&gt;&gt; class MyType(type): __subclasscheck__ = lambda cls, other_cls: True
  &gt;&gt;&gt; class O(Exception, metaclass=MyType): pass
  &gt;&gt;&gt; issubclass(3, O)
  0: True
  &gt;&gt;&gt; issubclass(int, O)
  1: True
  &gt;&gt;&gt; try:
  ...     1/0
  ... except O:
  ...     print('Success')
  Traceback (most recent call last):
    File "&lt;pyshell#4&gt;", line 2, in &lt;module&gt;
      1/0
  ZeroDivisionError: division by zero
  &gt;&gt;&gt; 
  </code></pre>