title: issubclass raises exception if first argument is not a class
body: <p>I am developing a Python application where i need many times to check if an object is a subclass of a DB model.</p>
  
  <p>I did my own function to do that:</p>
  
  <pre><code>def isModel(obj):
      return isinstance(obj, type) and issubclass(obj, Model)
  </code></pre>
  
  <p><code>issubclass</code> raises exception of obj is not a class, but i would like it just return False if <code>obj</code> is not a class.</p>
  
  <p>I thought better to make another function, to use instead of the built-in <code>issubclass</code>:</p>
  
  <pre><code>def _issubclass(obj, Klass):
      return isinstance(obj, type) and issubclass(obj, Klass)
  </code></pre>
  
  <p>But why the built-in <code>issubclass</code> was not made like that? What's the reason? Am i missing something?</p>
  
  <hr>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I have models:</p>
  
  <pre><code>class BaseModel(object):
      id = Field(...)
  
  class MyModel(BaseModel):
      deleted = Field(...)
  </code></pre>
  
  <p>In a function i want check if an argument is a <code>BaseModel</code>:</p>
  
  <pre><code>def update_model(model):
      assert isinstance(model, type) and issubclass(model, BaseModel), 'Must be a model'
  </code></pre>
  
  <p><code>issubclass</code> answers the question if an object is a sub-class of the given class. If the object is a class instance, so the answer, IMO, should be 'No, your object is not a BaseModel subclass, because it's not a class at all'.</p>
  
  <p>In Python is quite normal instead of <code>if something is not None or len(something) != 0</code> to use <code>if something</code> and not raising any <code>TypeError</code>. What's the usefulness of raising TypeError if the first argument of <code>issubclass</code> is not a class?</p>
  
  <p>For example someone asks a dog: 'Are you the right man to solve this task?', and instead of answering 'No', the dog says 'I am not a man'. I asked someone one thing (is sub class) and he didn't answer my question.</p>