So it turns out that defining a
and b
outside of the __init__
constructor function defines those variables as so-called class variables which are shared across all "instances" (objects) of that class. This does not explain how the values of b
are kept separate, but defining a
inside of the constructor as self.a = [0, 0]
seems to do the trick.