title: What is the use of Python's basic optimizations mode? (python -O)
body: <p>Python has a flag <code>-O</code> that you can execute the interpreter with. The option will generate "optimized" bytecode (written to .pyo files), and given twice, it will discard docstrings. From Python's man page:</p>
  
  <blockquote>
    <p>-O Turn on basic optimizations.  This changes the  filename  extension 
    for  compiled  (bytecode)  files from .pyc to .pyo.  Given twice,
    causes docstrings to be discarded.</p>
  </blockquote>
  
  <p>This option's two major features as I see it are:</p>
  
  <ul>
  <li><p>Strip all assert statements. This trades defense against corrupt program state for speed. But don't you need a ton of assert statements for this to make a difference? Do you have any code where this is worthwhile (and sane?)</p></li>
  <li><p>Strip all docstrings. In what application is the memory usage so critical, that this is a win? Why not push everything into modules written in C?</p></li>
  </ul>
  
  <p>What is the use of this option?
  Does it have a real-world value?</p>