def cast_to_list(position):
@wrapt.decorator<EOL>def wrapper(function, instance, args, kwargs):<EOL><INDENT>if not isinstance(args[position], list):<EOL><INDENT>args = list(args)<EOL>args[position] = [args[position]]<EOL>args = tuple(args)<EOL><DEDENT>return function(*args, **kwargs)<EOL><DEDENT>return wrapper<EOL>
Cast the positional argument at given position into a list if not already a list.