if type_str == "int":
return tuple(map(int, values))
if type_str == "float":
return tuple(map(float, values))
if type_str == "str":
return tuple(values)
else:
raise ValueError("unknown array type_str {}".format(string_input))
After Change
if type_str == "int":
return tuple(int(val) for val in values)
if type_str == "float":
return tuple(float(val) for val in values)
if type_str == "str":
return tuple(values)
else:
raise ValueError("unknown array type_str {}".format(string_input))