File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1555,6 +1555,25 @@ def f(l: complex, r: complex) -> None:
15551555 with self .subTest (l = l , r = r , x = x , y = y ):
15561556 script_helper .assert_python_ok ("-c" , s )
15571557
1558+ def test_symbols_flow_through_tuples (self ):
1559+ def testfunc (n ):
1560+ for _ in range (n ):
1561+ a = 1
1562+ b = 2
1563+ t = a , b
1564+ x , y = t
1565+ r = x + y
1566+ return r
1567+
1568+ res , ex = self ._run_with_optimizer (testfunc , TIER2_THRESHOLD )
1569+ self .assertEqual (res , 3 )
1570+ self .assertIsNotNone (ex )
1571+ uops = get_opnames (ex )
1572+ self .assertIn ("_BINARY_OP_ADD_INT" , uops )
1573+ self .assertNotIn ("_GUARD_BOTH_INT" , uops )
1574+ self .assertNotIn ("_GUARD_NOS_INT" , uops )
1575+ self .assertNotIn ("_GUARD_TOS_INT" , uops )
1576+
15581577 def test_decref_escapes (self ):
15591578 class Convert9999ToNone :
15601579 def __del__ (self ):
You can’t perform that action at this time.
0 commit comments