cls, raw_value: Optional[Iterable[str]], *, address: Address
) -> Optional[Tuple[str, ...]]:
value_or_default = super().compute_value(raw_value, address=address)
if value_or_default is None:
return None
try:
ensure_str_list(value_or_default)
except ValueError:
raise InvalidFieldTypeException(
address,
cls.alias,
raw_value,
expected_type="an iterable of strings (e.g. a list of strings)",
)
return tuple(value_or_default)
class StringOrStringSequenceField(PrimitiveField, metaclass=ABCMeta):
The raw_value may either be a string or be an iterable of strings.
After Change
def compute_value(
cls, raw_value: Optional[Iterable[str]], *, address: Address
) -> Optional[Tuple[str, ...]]:
return super().compute_value(raw_value, address=address)
class StringOrStringSequenceField(SequenceField, metaclass=ABCMeta):
The raw_value may either be a string or be an iterable of strings.