title: What is the correct way to reassign a list in Python?
body: <p>Should I;</p>
  
  <pre><code>a = range(100)
  old_list = filter(lambda x: x not in a, old_list)
  a = range(200)
  old_list = filter(lambda x: x not in a, old_list)
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>a = range(100)
  old_list = filter(lambda x: x not in a, old_list)
  a[:] = range(200)
  old_list = filter(lambda x: x not in a, old_list)
  </code></pre>
  
  <p>And more importantly, does it matter? In the first, are the elements in a freed, is their reference count 0? Or do the program still need the references to it. If so, I'm completely overwriting the references in the second example.</p>