> def b(item, a): > a.val = a.val + 1 > return item + a.val
This is where the problem lies, specifically the line a.val = a.val + 1 What happens here is that the 1st a.val refers to a member of the class instance a, called val ... which does not yet exist and is therefore created as the result of taking the val member of the class A and adding 1 to it. In other words, a.val is not the same variable as A.val. Are you following? If not, change your b() method to this: def b(item, a): a.val = a.val + 1 assert a.val is A.val return item + a.val and see what happens. -- http://mail.python.org/mailman/listinfo/python-list