title: Why does comparison of a numpy array with a list consume so much memory?
body: <p>This bit stung me recently. I solved it by removing all comparisons of numpy arrays with lists from the code. But why does the garbage collector miss to collect it?</p>
  
  <p>Run this and watch it eat your memory:</p>
  
  <pre><code>import numpy as np
  r = np.random.rand(2)   
  l = []
  while True:
      r == l
  </code></pre>
  
  <p>Running on 64bit Ubuntu 10.04, virtualenv 1.7.2, Python 2.7.3, Numpy 1.6.2</p>