I am baffled by the Python behaviour below. Why the attributes of second and third instances (b, c), i, are the class attribute i but a behaves differently?
In [47]: class Foo:
...: i=0
...:
In [48]: a = Foo()
In [49]: a.i = 1
In [50]: a.i
Out[50]: 1
In [51]: Foo.i
Out[51]: 0
In [52]: b = Foo()
In [53]: b.i
Out[53]: 0
In [54]: Foo.i is b.i
Out[54]: True
In [55]: Foo.i is a.i
Out[55]: False
In [56]: c = Foo()
In [57]: Foo.i is c.i
Out[57]: True
int is int... Python caches small integers. Perhaps it is better to use a dummy class for such demonstrations, although, in this case I don't think it will affect your demonstration.