David Eppstein wrote:
A, B, and C *are* instance variables. Why do you think they aren't?
What? They are class attributes that live in the class dictionary, not the instance dictionary.
They are instance variables on the class object, which is an instance of type 'class'.
I think the confusion that is brewing here is how Python masks class attributes when you do an assignment on an instance::
... A = 42 ... [12213 refs]
bar = foo()
42 [12220 refs]
bar.A = 13
42 [12223 refs]
Python's resolution order checks the instance first and then the class (this is ignoring a data descriptor somewhere in this chain; for the details read Raymond's essay on descriptors @ http://users.rcn.com/python/download/Descriptor.htm#invoking-descriptors ).