from functools import partial


def delayed(method):
    """delayed(method) takes method with signature:
    
    func(arg, *args)

    and makes a new methodwith signature:

    delayed_func(arg)(*args)

    That is, it delays the evaluation of the method until the returned
    function is called.
    """
    def delayed_func(self, attr):
        return partial(method, self, attr)
    delayed_func.__doc__ =  (
        """Delayed execution (via call) version of:\n%s""" %
        method.__doc__
        )
    return delayed_func