summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unpack.py
diff options
context:
space:
mode:
authorDennis Sweeney <36520290+sweeneyde@users.noreply.github.com>2022-04-17 18:04:29 (GMT)
committerGitHub <noreply@github.com>2022-04-17 18:04:29 (GMT)
commitcec5d858f509ea28a5325b75fd94e2f275866f5f (patch)
treefd1a12cd8c374b3eddca3f5ef1baaff98fefd217 /Lib/test/test_unpack.py
parent7659681556977fe3a19d9f4c5dd93362b9eae25c (diff)
downloadcpython-cec5d858f509ea28a5325b75fd94e2f275866f5f.zip
cpython-cec5d858f509ea28a5325b75fd94e2f275866f5f.tar.gz
cpython-cec5d858f509ea28a5325b75fd94e2f275866f5f.tar.bz2
gh-91625: Don't ignore extended args of adaptive opcodes (GH-91626)
Diffstat (limited to 'Lib/test/test_unpack.py')
-rw-r--r--Lib/test/test_unpack.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_unpack.py b/Lib/test/test_unpack.py
index 472c834..f5ca1d4 100644
--- a/Lib/test/test_unpack.py
+++ b/Lib/test/test_unpack.py
@@ -151,5 +151,21 @@ def load_tests(loader, tests, pattern):
return tests
+class TestCornerCases(unittest.TestCase):
+ def test_extended_oparg_not_ignored(self):
+ # https://github.com/python/cpython/issues/91625
+ target = "(" + "y,"*400 + ")"
+ code = f"""def unpack_400(x):
+ {target} = x
+ return y
+ """
+ ns = {}
+ exec(code, ns)
+ unpack_400 = ns["unpack_400"]
+ # Warm up the the function for quickening (PEP 659)
+ for _ in range(30):
+ y = unpack_400(range(400))
+ self.assertEqual(y, 399)
+
if __name__ == "__main__":
unittest.main()