def wrap_methods(cls, wrapper):
    for key, value in list(cls.__dict__.items()):
        if hasattr(value, '__call__'):
            setattr(cls, key, wrapper(value))
How to wrap every method of a class?