Skip to content

Commit d356fb0

Browse files
committed
gh-145866: Move list literal outside loop in test_binary_subscr_list_slice
1 parent c951668 commit d356fb0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/test_capi/test_opt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4051,8 +4051,8 @@ def testfunc(n):
40514051
def test_binary_subscr_list_slice(self):
40524052
def testfunc(n):
40534053
x = 0
4054+
l = [1, 2, 3]
40544055
for _ in range(n):
4055-
l = [1, 2, 3]
40564056
x += l[0:1][0]
40574057
return x
40584058

@@ -4062,8 +4062,8 @@ def testfunc(n):
40624062

40634063
self.assertIn("_BINARY_OP_SUBSCR_LIST_SLICE", uops)
40644064
self.assertNotIn("_GUARD_TOS_LIST", uops)
4065-
self.assertEqual(count_ops(ex, "_POP_TOP"), 3)
4066-
self.assertEqual(count_ops(ex, "_POP_TOP_NOP"), 5)
4065+
self.assertEqual(count_ops(ex, "_POP_TOP"), 2)
4066+
self.assertEqual(count_ops(ex, "_POP_TOP_NOP"), 4)
40674067

40684068
def test_is_op(self):
40694069
def test_is_false(n):

0 commit comments

Comments
 (0)