Closed

Description
Hi guys! I have this code:
def foo(field: Union[str, Tuple[str, ...]]) -> None:
fields_sequence: Sequence[str] = field if isinstance(field, tuple) else (field,)
print(fields_sequence)
That looks fine for me but mypy reports the next error:
error: Incompatible types in assignment (expression has type "object", variable has type "Sequence[str]")
Actually, there are two tuples on both ternary operator sides. I think this is a defect.
Metadata
Metadata
Assignees
Labels
No labels