title: Class objects created and assigned to a dictionary were changed
body: <p>Code:</p>
  
  <pre><code>import itertools
  
  class pt:
    def __init__(self,x,y):
      pt.x = x
      pt.y = y
  
  tuple_list = list(itertools.product([x+1 for x in range(9)],[x+1 for x in range(9)]))
  dict1 = {}
  for i in tuple_list:
    dict1[i] = pt(*i)
  
  print(dict1[(3,3)].x)
  print(dict1[(3,3)].y)
  </code></pre>
  
  <p>Expected Output:</p>
  
  <pre><code>3
  3
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>9
  9
  </code></pre>
  
  <p>Why did it output <code>9 9</code>?</p>
  
  <p>I wonder why the <code>pt</code> objects created and assigned to the dictionary were changed.  Do I need to create another list to store the <code>pt</code> objects? Does a dictionary only store the reference to the object (memory location) rather than the object itself?</p>