Based on the explanation on Shared Variables in Python Class here , I expected the following code to give output as :
123 123
200 200
300 300
But it is
123 123
200 123
200 300
Code:
class A:
    abc = 123
    def __init__(self, a,b,c):
        self._a = a
        self._b = b
        self._c = c
if __name__ == '__main__':
    a = A(2, 4, 6)
    b = A(3, 9, 27)
    print a.abc , b.abc
    a.abc = 200
    print a.abc , b.abc
    A.abc = 300
    print a.abc , b.abc
Can somebody please help understand this ? My impression is that shared variables are same as static variables in C++ classes. Any insights to bust that myth, if it is so, would be helpful too.