Each time you place parens after a class, you are constructing a new instance object of the class. So the things you printed were brand-spanking new and did not reflect the short-lived assignments you had made previously.
Here is an example (expanded to cover the underlying reference to class C):
>>> class C: ... red = 2 ... def __init__(self): ... self.blue = 2 ... >>> C.red 2 >>> C.blue Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: type object 'C' has no attribute 'blue' >>> C().red 2 >>> C().blue 2 >>> #OOOOH! ... >>> z = C() >>> z.red 2 >>> z.blue 2 >>> D = C >>> D.red 2 >>> D().red 2 >>> D().red = "over 9000!" >>> D.red 2 >>> D.red = "No, really over 9000!" >>> D.red 'No, really over 9000!' >>> C.red 'No, really over 9000!' >>> #OOOOOOHHHH! ...
Note that we did change the class directly when I assigned D.red = "No, really over 9000!" -- because that was referencing the class definition itself, not an instantiated object created from it. Note also that assigning an attribute of D (a copy) changed the attribute of C (the original) because in many (but not all) cases Python makes such assignments by reference, meaning that D is really an alias of C, not copy of the underlying structure. Read up on Python's deepcopy() method for more about that particularly startling detail.
Walk through the example code carefully, note the difference between referencing ClassName and calling ClassName(). The first is a reference via a variable name to a class definition -- a blueprint for generating instance objects that carries a constructor function __init__() with it. The second is an invokation of __init__() whose return value is an instance object of the class within which it is defined.
This is also why you can do things like this:
def some_fun(another_fun, value): another_fun(value) def foo(v): return v + v def bar(v): return v * v some_fun(foo, 5) some_fun(bar, 5)
This feature lends Python a high degree of flexibility in building functional abstractions. (Now if only it had tail-call elimination...)