Hi, I was writing a Python script to perform some data analyses and was surprised by some behavior I noted. A simple test program illustrating the behavior is below. I do not understand why the value of 'data' is being modified. I am obviously missing something obvious, and would certainly appreciate an explanation of why this is happening.
Thank you. -gf ---------- #!/bin/env python class TestPop(object): def round1(self,data1): t = data1.pop(-1) def round2(self,data2): t = data2.pop(-1) def tester(self): data = range(10) self.round1(data) print data self.round2(data) print data if __name__ == '__main__': tp = TestPop() tp.tester() -- http://mail.python.org/mailman/listinfo/python-list