title: Why am I getting TypeError: 'module' object is not callable in python?
body: <p>I'm creating a string that I an then use in a method that queries a mongodb collection.  Eventually the dates will be from user input.  Here's the relevant code and string:</p>
  
  <pre><code>import pymongo
  from pymongo import MongoClient
  from datetime import datetime
  import time
  import datetime
  start_yr    = 2015
  start_mnth  = 2
  start_day   = 1
  end_yr      = 2015
  end_mnth    = 2
  end_day     = 28
  
  # this is the line called in the error
  created_at_string = { "created_at": {"$gte" : datetime(start_yr, start_mnth, start_day),"$lt" : datetime(end_yr, end_mnth, end_day)}}
  </code></pre>
  
  <p>The idea will be to use <code>created_at_string</code> as an argument in more complex query methods.</p>
  
  <p>I'm getting:</p>
  
  <pre><code>Traceback (most recent call last):
    File "main.py", line 218, in &lt;module&gt;
      program.runProgram()
    File "main.py", line 61, in runProgram
      report.RcreateReport()
    File "/filepath/report.py", line 95, in RcreateReport
   created_at_string = { "created_at": {"$gte" : datetime(start_yr, start_mnth, start_day),"$lt" : datetime(end_yr, end_mnth, end_day)}}
  TypeError: 'module' object is not callable
  </code></pre>
  
  <p>Why?</p>