Specify action to be performed at the end of many functions
Question: I have a python object in which a bunch of functions need to perform the same
action at the end of execution, just before the `return` statement. For
example:

    
    
    def MyClass(object):
        def __init__(self):
            pass
    
        def update_everything(self):
            '''update everything'''
            pass
    
        def f1(self):
            #do stuff
            self.update_everything()
            return result
    
        def f2(self):
            #do stuff
            self.update_everything()
            return result
    
        def f3(self):
            #do stuff
            self.update_everything()
            return result
    

What is the best (pythonic?) way to do this, except for the explicit calls at
the end of each function?


Answer: I think that any solution to your problem would be unpythonic, because (as Tim
Peters says in the Zen of Python (`import this`)):

    
    
    Explicit is better than implicit.
    

