def return_arg_type(at_position):
def decorator(to_wrap):<EOL><INDENT>@functools.wraps(to_wrap)<EOL>def wrapper(*args, **kwargs):<EOL><INDENT>result = to_wrap(*args, **kwargs)<EOL>ReturnType = type(args[at_position])<EOL>return ReturnType(result)<EOL><DEDENT>return wrapper<EOL><DEDENT>return decorator<EOL>
Wrap the return value with the result of `type(args[at_position])`