title: Appending to list in Python dictionary
body: <p>Is there a more elegant way to write this code? </p>
  
  <p>What I am doing: I have keys and dates. There can be a number of dates assigned to a key and so I am creating a dictionary of lists of dates to represent this. The following code works fine, but I was hoping for a more elegant and Pythonic method. </p>
  
  <pre><code>dates_dict = dict() 
  for key,  date in cur:
      if key in dates_dict:
          dates_dict[key].append(date)
      else:
          dates_dict[key] = [date] 
  </code></pre>
  
  <p>I was expecting the below to work, but I keep getting a NoneType has no attribute append error. </p>
  
  <pre><code>dates_dict = dict() 
  for key,  date in cur:
      dates_dict[key] = dates_dict.get(key, []).append(date) 
  </code></pre>
  
  <p>This probably has something to do with the fact that</p>
  
  <pre><code>print([].append(1)) 
  None 
  </code></pre>
  
  <p>but why?</p>