Example of dynamically decorating a method in Python