@@ -17,7 +17,7 @@ def no_perf(f):
1717class MyClass :
1818 x : int
1919 y : str
20- __match_args__ = [ "x" , "y" ]
20+ __match_args__ = ( "x" , "y" )
2121
2222
2323@dataclasses .dataclass
@@ -2018,7 +2018,7 @@ def f(color):
20182018
20192019 def test_patma_200 (self ):
20202020 class Class :
2021- __match_args__ = [ "a" , "b" ]
2021+ __match_args__ = ( "a" , "b" )
20222022 c = Class ()
20232023 c .a = 0
20242024 c .b = 1
@@ -2046,7 +2046,7 @@ def test_patma_202(self):
20462046 class Parent :
20472047 __match_args__ = "a" , "b"
20482048 class Child (Parent ):
2049- __match_args__ = [ "c" , "d" ]
2049+ __match_args__ = ( "c" , "d" )
20502050 c = Child ()
20512051 c .a = 0
20522052 c .b = 1
@@ -2500,7 +2500,7 @@ class Class:
25002500 @no_perf
25012501 def test_patma_248 (self ):
25022502 class Class :
2503- __match_args__ = [ None ]
2503+ __match_args__ = ( None ,)
25042504 x = Class ()
25052505 y = z = None
25062506 with self .assertRaises (TypeError ):
@@ -2513,7 +2513,7 @@ class Class:
25132513 @no_perf
25142514 def test_patma_249 (self ):
25152515 class Class :
2516- __match_args__ = []
2516+ __match_args__ = ()
25172517 x = Class ()
25182518 y = z = None
25192519 with self .assertRaises (TypeError ):
@@ -2560,7 +2560,7 @@ class Keys:
25602560 @no_perf
25612561 def test_patma_253 (self ):
25622562 class Class :
2563- __match_args__ = [ "a" , "a" ]
2563+ __match_args__ = ( "a" , "a" )
25642564 a = None
25652565 x = Class ()
25662566 w = y = z = None
@@ -2575,7 +2575,7 @@ class Class:
25752575 @no_perf
25762576 def test_patma_254 (self ):
25772577 class Class :
2578- __match_args__ = [ "a" ]
2578+ __match_args__ = ( "a" ,)
25792579 a = None
25802580 x = Class ()
25812581 w = y = z = None
@@ -2841,6 +2841,22 @@ def test_patma_281(self):
28412841 self .assertEqual (x , range (10 ))
28422842 self .assertIs (y , None )
28432843
2844+ @no_perf
2845+ def test_patma_282 (self ):
2846+ class Class :
2847+ __match_args__ = ["spam" , "eggs" ]
2848+ spam = 0
2849+ eggs = 1
2850+ x = Class ()
2851+ w = y = z = None
2852+ with self .assertRaises (TypeError ):
2853+ match x :
2854+ case Class (y , z ):
2855+ w = 0
2856+ self .assertIs (w , None )
2857+ self .assertIs (y , None )
2858+ self .assertIs (z , None )
2859+
28442860
28452861class PerfPatma (TestPatma ):
28462862
0 commit comments