title: Python: Define array as instance class attribute
body: <p>I need to have several objects that each one has an individual array. I have written this code:</p>
  
  <pre><code>    read_values = list()
      for read_unit in read_units:
          read_value = ReadValues.objects.all().filter(ReadID=read_unit.ReadID)
  
          element = TempObjectForReadValues()
          for read_element in read_value:
              element.read_elements[read_element.Code] = read_element.ReadValue
          read_values.append(element)
          print(element.read_elements)
  
      print('  ')
      for test_element in read_values:
          print(test_element.read_elements)
  </code></pre>
  
  <p>And this is how I defined the class:</p>
  
  <pre><code>    class TempObjectForReadValues():
          read_elements = [None] * 10
  </code></pre>
  
  <p>The result is:</p>
  
  <pre><code>[None, None, 16.0, None, 189.0, 345.0, None, None, None, None]
  [None, None, 16.0, 43.0, 876.0, 345.0, None, None, None, None]
  
  [None, None, 16.0, 43.0, 876.0, 345.0, None, None, None, None]
  [None, None, 16.0, 43.0, 876.0, 345.0, None, None, None, None]
  </code></pre>
  
  <p>That means the data are overwritten on the previous ones. Also if I do not assign anything to the array in new object, it holds the results from previous one. :(</p>
  
  <p>How can I fix it?</p>