title: Why does Python 2 allow comparisons between lists and numbers?
body: <p>I recently discovered a typo in my program</p>
  
  <pre><code>while len(first_list) &gt; second_list:
      do_stuff
  </code></pre>
  
  <p>I played around with this and discovered that <code>5 &lt; ["apple"] == True</code> and <code>5 &gt; ["apple"] == False</code></p>
  
  <p>Why does Python allow these sorts of comparisons? What is being evaluated under the hood to determine that <code>5</code> is less than <code>["apple"]</code>?</p>