title: Python boolean expression and or
body: <p>In python if you write something like</p>
  
  <pre><code>foo==bar and spam or eggs
  </code></pre>
  
  <p>python appears to return spam if the boolean statement is true and eggs otherwise. Could someone explain this behaviour? Why is the expression not being evaluated like one long boolean?</p>
  
  <p>Edit: Specifically, I'm trying to figure out the mechanism why 'spam' or 'eggs' is being returned as the result of the expression.</p>