summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_peepholer.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2005-01-26 12:50:05 (GMT)
committerRaymond Hettinger <python@rcn.com>2005-01-26 12:50:05 (GMT)
commit9feb267cafb9452826694e5e098317c8b2799fe8 (patch)
tree88b364b176d24a45a472dd6ef10383771272deeb /Lib/test/test_peepholer.py
parentc560a00966e035fad3499067dc6a4d7b7dbc9d7e (diff)
downloadcpython-9feb267cafb9452826694e5e098317c8b2799fe8.zip
cpython-9feb267cafb9452826694e5e098317c8b2799fe8.tar.gz
cpython-9feb267cafb9452826694e5e098317c8b2799fe8.tar.bz2
Do not fold a constant if a large sequence will result.
Saves space in the presence of code like: (None,)*10000
Diffstat (limited to 'Lib/test/test_peepholer.py')
-rw-r--r--Lib/test/test_peepholer.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_peepholer.py b/Lib/test/test_peepholer.py
index 4222424..34bd99f 100644
--- a/Lib/test/test_peepholer.py
+++ b/Lib/test/test_peepholer.py
@@ -129,6 +129,10 @@ class TestTranforms(unittest.TestCase):
self.assert_('(2)' in asm)
self.assert_("('b')" in asm)
+ # Verify that large sequences do not result from folding
+ asm = dis_single('a="x"*1000')
+ self.assert_('(1000)' in asm)
+
def test_elim_extra_return(self):
# RETURN LOAD_CONST None RETURN --> RETURN
def f(x):