title: Efficiently adding elements to a list in python
body: <p>I'm iterating through a list of over three million items and am assigning them integer values. For organization, I have made a dictionary whose keys are the integers and values are the list of items with that score. A priori, I <em>do not</em> know how many items will have a certain score, so I'm using the + operator to append onto the list as follows:</p>
  
  <pre><code>for e in xs:
     myDict[val(e)] = myDict.get(val,[]) + [e]
  </code></pre>
  
  <p>My questions are:</p>
  
  <ol>
  <li>Is there a cleaner way of doing this?</li>
  <li>What's the time complexity of the + operation? Is it creating an entirely new list, copying the elements from the original list, and adding them in?</li>
  <li>What if I was adding an element to a set? </li>
  </ol>