title: Appending object to list
body: <p>I am trying to append objects to a list. However after the second append the first item change in the list.
  Can you tell me how to make it work?</p>
  
  <p>It works if <code>x</code> is not a <code>numpy</code> array but a simple float variable.</p>
  
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  
  class TestClass:
      def __init__(self, x_in):
          self.x = x_in
  
  x = np.zeros((2, 1))
  filters = []
  
  x[0] = 1
  filters.append(TestClass(x))
  print(filters[0].x)
  
  x[0] = 2
  filters.append(TestClass(x))
  print(filters[0].x)
  print(filters[1].x)
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>[[1.]
   [0.]]
  
  [[1.]
   [0.]]
  [[2.]
   [0.]]
  </code></pre>
  
  <p>Actual output (first item changed):</p>
  
  <pre><code>[[1.]
   [0.]]
  
  [[2.]
   [0.]]
  [[2.]
   [0.]]
  </code></pre>