title: TypeError: first argument must be callable or None - error is not coming first time but coming later
body: <p>I am having this line to create a defaultdict and initialize it with a list as a value. </p>
  
  <pre><code>page_by_due_date = defaultdict(list)
  due_pages_list = []
  
  for page, page_summary_dict in summary_by_page.items():
      scheduled_due_date = page_summary_dict.get('8.scheduled_due_date')
      page_by_due_date[str(scheduled_due_date)].append(page)
      if scheduled_due_date &lt;= datetime.date.today():
          due_pages_list.append(page)
  
  print(sorted(due_pages_list))
  pprint.pprint(page_by_due_date)
  </code></pre>
  
  <p>When I run this code first time, it works properly. But if I rerun this code, I get this error. I do not know why it is considering 'list' as not callable. I am using Jupyter notebook - if I restart kernel and run the code again, it works. </p>
  
  <pre><code>---------------------------------------------------------------------------
      TypeError                                 Traceback (most recent call last)
      &lt;ipython-input-25-56b08ad56f3e&gt; in &lt;module&gt;
      ----&gt; 1 page_by_due_date = defaultdict(list)
            2 due_pages_list = []
            3 
            4 for page, page_summary_dict in summary_by_page.items():
            5     scheduled_due_date = page_summary_dict.get('8.scheduled_due_date')
  
      TypeError: first argument must be callable or None
  </code></pre>
  
  <p>Please note that I have done a google search and read through these 2 posts already and they do not answer my question:</p>
  
  <p><a href="https://stackoverflow.com/questions/21422670/typeerror-first-argument-must-be-callable?rq=1">TypeError: first argument must be callable</a></p>
  
  <p><a href="https://stackoverflow.com/questions/42137849/defaultdict-first-argument-must-be-callable-or-none">defaultdict : first argument must be callable or None</a></p>