Here is my code: class A(): val = 0
def b(item, a): a.val = a.val + 1 return item + a.val def c(): d = [1, 2, 3] print [b(item, A()) for item in d] c() I expected this to output [2, 4, 6]. However, it outputs [2, 3, 4] which is not what I wanted. I thought that if I passed the A() instance in my list comprehension in c(), then the changes I made to a.val in b() would be reflected in the A() instance next time the list comprehension called b(). But, obviously that is not happening. I'm kinda new at python so I may be missing something obvious here. Any suggestions? -- http://mail.python.org/mailman/listinfo/python-list