'Return a decorator that attaches a callback to a hook. See
:meth:`add_hook` for details.'

def hook(self, name):

    def decorator(func):
        self.add_hook(name, func)
        return func
    return decorator
