regex = re.compile(STATEMENT)
matched_str = regex.match(string_input)
if matched_str:
filtered_groups = list(filter(None, matched_str.groups()))
if not filtered_groups:
return ()
try:
values = [v.strip() for v in filtered_groups[0].split(",")]
After Change
raise ValueError(
"unrecognised input string {}".format(string_input))
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)