title: Why does this happen with classes
body: <p>I have written following class which does the following:</p>
  
  <pre><code>class abc:
      def __init__(self):
          self.Values = []
      def add_code(self):
          lastval = self.Values
          print "self.Values  , ", self.Values
          print "lastval  , ", lastval
          lastval.append(1)
          print "self.Values 1, ", self.Values
          print "lastval 1 , ", lastval
  
          lastval.append(2)
          print "lastval 2 , ", lastval
          print "self.Values 2 , ", self.Values
          lastval.append(3)
          print "lastval 3 , ", lastval
          print "self.Values 3 , ", self.Values
          lastval.append(4)
          print "last val 4 ", lastval
          print "self.Values 4 , ", self.Values
          lastval = []
          print "last value is emtpy now? , ", lastval
          print "But the self.Values is not", self.Values
          return lastval
  </code></pre>
  
  <p>When I run this code I see that the variable <code>lastval</code> gets appended with the values and so does the <code>self.Values</code>
  But when I initialize the <code>lastval</code> with empty list, I still see <code>self.Values</code> holds to the values. 
  What could be the reason </p>