Skip to content

Commit ebc59ef

Browse files
fix mypy error from overlapping variable
1 parent 9ca630c commit ebc59ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mypy/checkpattern.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ def visit_sequence_pattern(self, o: SequencePattern) -> PatternType:
315315
inner_types = [make_simplified_union([*sequence_types, *x]) for x in zip(*tuple_types)]
316316
else:
317317
object_type = self.chk.named_type("builtins.object")
318-
inner_type = make_simplified_union(sequence_types) if sequence_types else object_type
319-
inner_types = [inner_type] * len(o.patterns)
318+
unioned = make_simplified_union(sequence_types) if sequence_types else object_type
319+
inner_types = [unioned] * len(o.patterns)
320320

321321
#
322322
# match inner patterns

0 commit comments

Comments
 (0)