title: How should I check that a given argument is a datetime.date object?
body: <p>I'm currently using an <code>assert</code> statement with <code>isinstance</code>. Because <code>datetime</code> is a subclass of <code>date</code>, I also need to check that it isn't an instance of <code>datetime</code>. Surely there's a better way?</p>
  
  <pre><code>from datetime import date, datetime
  
  def some_func(arg):
      assert isinstance(arg, date) and not isinstance(arg, datetime),\
          'arg must be a datetime.date object'
      # ...
  </code></pre>