I feel very stupid right now. Should be an easy question, but I googled it to no avail. Basically, I have an class.object in my code which should be managed by a class.function For example, I want the following code: Code (Text): class Z: a=0 def mod(self): self.a=self.a+1 t=Z print Z.a t.mod print Z.a t.a+=1 print Z.a to return "0 1 2", instead of "0 0 1" Can it be done in Python? If yes, what is the Python way of doing so? If no, why not?