@@ -563,10 +563,9 @@ def f():
563563def f():
564564 r0, r1 :: object
565565 r2 :: bool
566- i :: int
567- r3 :: object
568- r4 :: str
569- r5, r6 :: object
566+ r3, i, r4 :: object
567+ r5 :: str
568+ r6 :: object
570569 r7 :: object[1]
571570 r8 :: object_ptr
572571 r9, r10 :: object
@@ -576,21 +575,22 @@ L0:
576575 r2 = CPy_TypeCheck(r1, r0)
577576 if r2 goto L1 else goto L3 :: bool
578577L1:
579- i = 246
578+ r3 = object 123
579+ i = r3
580580L2:
581- r3 = builtins :: module
582- r4 = 'print'
583- r5 = CPyObject_GetAttr(r3, r4)
584- r6 = box(int, i)
585- r7 = [r6]
581+ r4 = builtins :: module
582+ r5 = 'print'
583+ r6 = CPyObject_GetAttr(r4, r5)
584+ r7 = [i]
586585 r8 = load_address r7
587- r9 = PyObject_Vectorcall(r5 , r8, 1, 0)
588- keep_alive r6
586+ r9 = PyObject_Vectorcall(r6 , r8, 1, 0)
587+ keep_alive i
589588 goto L4
590589L3:
591590L4:
592591 r10 = box(None, 1)
593592 return r10
593+
594594[case testMatchClassPatternWithPositionalArgs_python3_10]
595595class Position:
596596 __match_args__ = ("x", "y", "z")
@@ -599,7 +599,7 @@ class Position:
599599 y: int
600600 z: int
601601
602- def f(x):
602+ def f(x) -> None :
603603 match x:
604604 case Position(1, 2, 3):
605605 print("matched")
@@ -641,7 +641,7 @@ def f(x):
641641 r28 :: object
642642 r29 :: object[1]
643643 r30 :: object_ptr
644- r31, r32 :: object
644+ r31 :: object
645645L0:
646646 r0 = __main__.Position :: type
647647 r1 = PyObject_IsInstance(x, r0)
687687 goto L6
688688L5:
689689L6:
690- r32 = box(None, 1)
691- return r32
690+ return 1
691+
692692[case testMatchClassPatternWithKeywordPatterns_python3_10]
693693class Position:
694694 x: int
@@ -848,7 +848,7 @@ class C:
848848 a: int
849849 b: int
850850
851- def f(x):
851+ def f(x) -> None :
852852 match x:
853853 case C(1, 2) as y:
854854 print("matched")
@@ -885,7 +885,7 @@ def f(x):
885885 r22 :: object
886886 r23 :: object[1]
887887 r24 :: object_ptr
888- r25, r26 :: object
888+ r25 :: object
889889L0:
890890 r0 = __main__.C :: type
891891 r1 = PyObject_IsInstance(x, r0)
925925 goto L6
926926L5:
927927L6:
928- r26 = box(None, 1)
929- return r26
928+ return 1
929+
930930[case testMatchClassPatternPositionalCapture_python3_10]
931931class C:
932932 __match_args__ = ("x",)
@@ -953,15 +953,14 @@ def f(x):
953953 r2 :: bit
954954 r3 :: bool
955955 r4 :: str
956- r5 :: object
957- r6, num :: int
958- r7 :: str
959- r8 :: object
960- r9 :: str
961- r10 :: object
962- r11 :: object[1]
963- r12 :: object_ptr
964- r13, r14 :: object
956+ r5, num :: object
957+ r6 :: str
958+ r7 :: object
959+ r8 :: str
960+ r9 :: object
961+ r10 :: object[1]
962+ r11 :: object_ptr
963+ r12, r13 :: object
965964L0:
966965 r0 = __main__.C :: type
967966 r1 = PyObject_IsInstance(x, r0)
@@ -971,22 +970,22 @@ L0:
971970L1:
972971 r4 = 'x'
973972 r5 = CPyObject_GetAttr(x, r4)
974- r6 = unbox(int, r5)
975- num = r6
973+ num = r5
976974L2:
977- r7 = 'matched'
978- r8 = builtins :: module
979- r9 = 'print'
980- r10 = CPyObject_GetAttr(r8, r9 )
981- r11 = [r7 ]
982- r12 = load_address r11
983- r13 = PyObject_Vectorcall(r10, r12 , 1, 0)
984- keep_alive r7
975+ r6 = 'matched'
976+ r7 = builtins :: module
977+ r8 = 'print'
978+ r9 = CPyObject_GetAttr(r7, r8 )
979+ r10 = [r6 ]
980+ r11 = load_address r10
981+ r12 = PyObject_Vectorcall(r9, r11 , 1, 0)
982+ keep_alive r6
985983 goto L4
986984L3:
987985L4:
988- r14 = box(None, 1)
989- return r14
986+ r13 = box(None, 1)
987+ return r13
988+
990989[case testMatchMappingEmpty_python3_10]
991990def f(x):
992991 match x:
@@ -1601,35 +1600,35 @@ def f(x):
16011600def f(x):
16021601 x, r0 :: object
16031602 r1 :: bool
1604- r2, y :: int
1605- r3 :: str
1606- r4 :: object
1607- r5 :: str
1608- r6 :: object
1609- r7 :: object[1]
1610- r8 :: object_ptr
1611- r9, r10 :: object
1603+ y :: object
1604+ r2 :: str
1605+ r3 :: object
1606+ r4 :: str
1607+ r5 :: object
1608+ r6 :: object[1]
1609+ r7 :: object_ptr
1610+ r8, r9 :: object
16121611L0:
16131612 r0 = load_address PyLong_Type
16141613 r1 = CPy_TypeCheck(x, r0)
16151614 if r1 goto L1 else goto L3 :: bool
16161615L1:
1617- r2 = unbox(int, x)
1618- y = r2
1616+ y = x
16191617L2:
1620- r3 = 'matched'
1621- r4 = builtins :: module
1622- r5 = 'print'
1623- r6 = CPyObject_GetAttr(r4, r5 )
1624- r7 = [r3 ]
1625- r8 = load_address r7
1626- r9 = PyObject_Vectorcall(r6, r8 , 1, 0)
1627- keep_alive r3
1618+ r2 = 'matched'
1619+ r3 = builtins :: module
1620+ r4 = 'print'
1621+ r5 = CPyObject_GetAttr(r3, r4 )
1622+ r6 = [r2 ]
1623+ r7 = load_address r6
1624+ r8 = PyObject_Vectorcall(r5, r7 , 1, 0)
1625+ keep_alive r2
16281626 goto L4
16291627L3:
16301628L4:
1631- r10 = box(None, 1)
1632- return r10
1629+ r9 = box(None, 1)
1630+ return r9
1631+
16331632[case testMatchSequenceCaptureAll_python3_10]
16341633def f(x):
16351634 match x:
0 commit comments