@@ -1753,7 +1753,7 @@ match m1:
17531753m2: tuple[int, str] | tuple[float, str]
17541754match m2:
17551755 case (a2, b2):
1756- reveal_type(a2) # N: Revealed type is "Union[ builtins.int, builtins.float] "
1756+ reveal_type(a2) # N: Revealed type is "builtins.int | builtins.float"
17571757 reveal_type(b2) # N: Revealed type is "builtins.str"
17581758
17591759m3: tuple[int] | tuple[float, str]
@@ -1780,30 +1780,30 @@ match m5:
17801780m6: tuple[int, Unpack[tuple[float, ...]]] | list[str]
17811781match m6:
17821782 case (a6, b6):
1783- reveal_type(a6) # N: Revealed type is "Union[ builtins.int, builtins.float, builtins.str] "
1784- reveal_type(b6) # N: Revealed type is "Union[ builtins.int, builtins.float, builtins.str] "
1783+ reveal_type(a6) # N: Revealed type is "builtins.int | builtins.float | builtins.str"
1784+ reveal_type(b6) # N: Revealed type is "builtins.int | builtins.float | builtins.str"
17851785
17861786# but do still separate types from non unpacked types
17871787m7: tuple[int, Unpack[tuple[float, ...]]] | tuple[str, str]
17881788match m7:
17891789 case (a7, b7, *rest7):
1790- reveal_type(a7) # N: Revealed type is "Union[ builtins.int, builtins.float, builtins.str] "
1791- reveal_type(b7) # N: Revealed type is "Union[ builtins.int, builtins.float, builtins.str] "
1792- reveal_type(rest7) # N: Revealed type is "builtins.list[Union[ builtins.int, builtins.float] ]"
1790+ reveal_type(a7) # N: Revealed type is "builtins.int | builtins.float | builtins.str"
1791+ reveal_type(b7) # N: Revealed type is "builtins.int | builtins.float | builtins.str"
1792+ reveal_type(rest7) # N: Revealed type is "builtins.list[builtins.int | builtins.float]"
17931793
17941794# verify that if we are unpacking, it will get the type of the sequence if the tuple is too short
17951795m8: tuple[int, str] | list[float]
17961796match m8:
17971797 case (a8, b8, *rest8):
1798- reveal_type(a8) # N: Revealed type is "Union[ builtins.float, builtins.int] "
1799- reveal_type(b8) # N: Revealed type is "Union[ builtins.float, builtins.str] "
1798+ reveal_type(a8) # N: Revealed type is "builtins.float | builtins.int"
1799+ reveal_type(b8) # N: Revealed type is "builtins.float | builtins.str"
18001800 reveal_type(rest8) # N: Revealed type is "builtins.list[builtins.float]"
18011801
18021802m9: tuple[str, str, int] | tuple[str, str]
18031803match m9:
18041804 case (a9, *rest9):
18051805 reveal_type(a9) # N: Revealed type is "builtins.str"
1806- reveal_type(rest9) # N: Revealed type is "builtins.list[Union[ builtins.str, builtins.int] ]"
1806+ reveal_type(rest9) # N: Revealed type is "builtins.list[builtins.str | builtins.int]"
18071807
18081808[builtins fixtures/tuple.pyi]
18091809
0 commit comments