We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bdfd74f commit 055b019Copy full SHA for 055b019
Lib/test/test_capi/test_opt.py
@@ -3953,12 +3953,13 @@ def testfunc(n):
3953
def test_match_class(self):
3954
def testfunc(n):
3955
class A:
3956
+ __match_args__ = ("val",)
3957
val = 1
3958
x = A()
3959
ret = 0
3960
for _ in range(n):
3961
match x:
- case A():
3962
+ case A(1):
3963
ret += x.val
3964
return ret
3965
@@ -3967,7 +3968,7 @@ class A:
3967
3968
uops = get_opnames(ex)
3969
3970
self.assertIn("_MATCH_CLASS", uops)
- self.assertEqual(count_ops(ex, "_POP_TOP_NOP"), 4)
3971
+ self.assertEqual(count_ops(ex, "_POP_TOP_NOP"), 5)
3972
3973
def test_143026(self):
3974
# https://github.com/python/cpython/issues/143026
0 commit comments