mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Do not fold a constant if a large sequence will result.
Saves space in the presence of code like: (None,)*10000
This commit is contained in:
parent
c560a00966
commit
9feb267caf
2 changed files with 19 additions and 5 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue