title: Which things can the Python interpreter optimize?
body: <p>I think due to <em>lazy evaluation</em> statements like:</p>
  
  <pre><code>if True and True (...):
      # do something
  </code></pre>
  
  <p>...should be skipped right after the <code>True and</code> part by the Python interpreter. However, in contrast to compiled Code, I think the Python interpreter can not optimize <em>bad style</em> like explicit boolean comparisions, right?</p>
  
  <pre><code>if condition == True:
      # do something
  </code></pre>
  
  <p>A compiler would optimize this and delete the <code>== True</code> part, but the interpreter <em>always</em> has to evaluate which statements wait after the <code>condition ==</code> part, thus doing the unnecessary comparison of <code>== True</code> every time the code is executed?!</p>
  
  <p>Do more of such pitfalls exist, where the interpreter can not optimize code? I know this last question is quite open, but I guess some popular examples do exist?</p>