def decorate_all_methods(decorator):
def decorate_class(cls):<EOL><INDENT>for name, m in inspect.getmembers(cls, inspect.ismethod):<EOL><INDENT>if name != "<STR_LIT>":<EOL><INDENT>setattr(cls, name, decorator(m))<EOL><DEDENT><DEDENT>return cls<EOL><DEDENT>return decorate_class<EOL>
Build and return a decorator that will decorate all class members.

This will apply the passed decorator to all of the methods in the decorated
class, except the __init__ method, when a class is decorated with it.