def action_set(method_name):
    """
    Creates a setter that will call the action method with the context's
    key as first parameter and the value as second parameter.
    @param method_name: the name of a method belonging to the action.
    @type method_name: str
    """

    def action_set(value, context, **_params):
        method = getattr(context["action"], method_name)
        return _set(method, context["key"], value, (), {})

    return action_set