16 bytes of Python that compile to 32 terabytes of bytecode (2016)
I thought that problem got fixed a few releases ago. Maybe 3.7, when some of the peephole optimizer logic was moved to the AST?<p>At the very least, I can't reproduce it.<p><pre><code>  % cat tmp.py
  (1<<19**8,)*4**7
  % python -m compileall tmp.py
  % ls -l __pycache__/tmp.cpython-39.pyc
  -rw-r--r--  1 eesmith  admin  167 Feb 16 12:21 __pycache__/tmp.cpython-39.pyc
</code></pre>
Python 3.6 generates a 144 byte file. One of the comments says it caused a problem in Python 3.3.5.<p>Another peephole optimizer gotcha that caused problems with older Pythons is at <a href="https://bugs.python.org/issue30416" rel="nofollow">https://bugs.python.org/issue30416</a> :<p><pre><code>  def tuple20():
      return ((((((((1,)*20,)*20,)*20,)*20,)*20,)*20,)*20,)*20
</code></pre>
If you have Python 2.7 hanging about, try simply defining that function - you can't even ^C it!