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 b821b8b commit f6eb00cCopy full SHA for f6eb00c
Lib/test/test_capi/test_opt.py
@@ -1648,17 +1648,16 @@ def f(n):
1648
1649
def test_binary_subcsr_str_int_narrows_to_str(self):
1650
def testfunc(n):
1651
- x = 0
+ x = []
1652
s = "foo"
1653
- z = ""
1654
for _ in range(n):
1655
y = s[0] # _BINARY_OP_SUBSCR_STR_INT
1656
z = "bar" + y # (_GUARD_TOS_UNICODE) + _BINARY_OP_ADD_UNICODE
1657
- x += 1
+ x.append(z)
1658
return x
1659
1660
res, ex = self._run_with_optimizer(testfunc, TIER2_THRESHOLD)
1661
- self.assertEqual(res, TIER2_THRESHOLD)
+ self.assertEqual(res, ["barf"] * TIER2_THRESHOLD)
1662
self.assertIsNotNone(ex)
1663
uops = get_opnames(ex)
1664
self.assertIn("_BINARY_OP_SUBSCR_STR_INT", uops)
0 commit comments