: : called three : : repeat : : repeat : : repeat : : repeat python introduces generic event-loop architecture similar to this we'll be discussing it later in concurrency using functions as attributes one of the interesting effects of functions being objects is that they can be set as callable attributes on other objects it is possible to add or change function to an instantiated objectclass adef print(self)print("my class is "def fake_print()print("my class is not " ( print( print fake_print print(this code creates very simple class with print method that doesn' tell us anything we didn' know then we create new function that tells us something we don' believe when we call print on an instance of the classit behaves as expected if we then set the print method to point at new functionit tells us something differentmy class is my class is not it is also possible to replace methods on classes instead of objectsalthough in that case we have to add the self argument to the parameter list this will change the method for all instances of that objecteven ones that have already been instantiated obviouslyreplacing methods like this can be both dangerous and confusing to maintain somebody reading the code will see that method has been called and look up that method on the original class but the method on the original class is not the one that was called figuring out what really happened can become trickyfrustrating debugging session