class A: this_is_original_variable_only_for_one_inctance = 0 def __init__(self, v): self.this_is_original_variable_only_for_one_inctance = v
class B: this_is_common_for_all_instances = [] def __init__(self, v): self.this_is_common_for_all_instances.append(v) ---------------- now I can create some instances of B, but all of them have the same array, why if I use append for b1.this_is_common_for_all_instances, the b2, b3 will have been changed that array. (where bi is instance of B) but changes on this_is_original_variable_only_for_one_inctance works fine why it does that? and how create array in class - normal array, "private variable" -- http://mail.python.org/mailman/listinfo/python-list