To quote diveintopython,
“You already know about data attributes, which are variables owned by
a specific instance of a class. Python also supports class attributes,
which are variables owned by the class itself.”
In what sense are class attributes owned by a class? If you change the value of a class attribute in a specific instance, that change is only reflected in that instance (and not in other instances of the class).
From my vantage point this makes class attributes fundamentally the same as data (i.e. instance) attributes (notwithstanding the syntactic differences).
In C++ change the value of a “class variable”, and that change is reflected in all instances.
What is the difference between the two?
I think that this example will explain the meaning to you.
In this case
b.barwill be owned by instance afterb.bar = 2buta.barwill still be owned by class. That is why it will be changed on instance after changing it on class andb.barwill not.