Skip to content

Commit e10b559

Browse files
committed
Ignore duplicates in join_type_list
1 parent 4a427e9 commit e10b559

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mypy/join.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,8 +885,9 @@ def join_type_list(types: Sequence[Type]) -> Type:
885885
# with all variable length tuples, and this makes it possible.
886886
return UninhabitedType()
887887
joined = types[0]
888-
for t in types[1:]:
889-
joined = join_types(joined, t)
888+
for i, t in enumerate(types[1:], 1):
889+
if t not in types[:i]:
890+
joined = join_types(joined, t)
890891
return joined
891892

892893

0 commit comments

Comments
 (0)