"A.i" is a class attribute. "a.i" at first is the same as "A.i". Once you set a.i = 2, you are actually creating a new data attribute called i for the instance a. This happens on the fly. So then when you reference a.i, it uses the instance data attribute, instead of the class attribute.
This might make it more clear. Try: a.f = 3 print a.f Even though f is not declared in your class definition, the above code still prints 3. Because it created the data attribute f on the fly. -- http://mail.python.org/mailman/listinfo/python-list