title: TypeError: unsupported type for timedelta days component: datetime.datetime
body: <p>I am trying to perform some date arithmetic in a function.</p>
  
  <pre><code>from datetime import datetime, timedelta
  
  def foo(date1, summing_period):
      current_period_start_date = date1 - timedelta(days=summing_period)
      # Line above causes the error:
      # TypeError: unsupported type for timedelta days component: datetime.datetime
  </code></pre>
  
  <p>First arg is a datetime obj and 2nd arg is an integer</p>
  
  <p>What is causing this error, and how do I fix it?</p>