def square_param(param):

    def func_decorator(func):

        def func_caller(*args, **kwargs):
            kwargs[param] = kwargs[param] * kwargs[param]
return func(*args, **kwargs)
return func_caller
return func_decorator
How can I treat positional arguments as keyword arguments in Python 2