title: In Python why is [2] less than (1,)?
body: <h2>BACKGROUND</h2>
  
  <p>I've been trying to work out why my AI has been making some crazy moves and I traced the problem back to the following behaviour when using Python 2.7.2</p>
  
  <pre><code>&gt;&gt;&gt; print [2]&gt;[1]
  True
  &gt;&gt;&gt; print (2,)&gt;(1,)
  True
  &gt;&gt;&gt; print [2]&gt;(1,)
  False                 (WHY?)
  
  &gt;&gt;&gt; print [2]&lt;[1]
  False
  &gt;&gt;&gt; print (2,)&lt;(1,)
  False
  &gt;&gt;&gt; print [2]&lt;(1,)
  True                  (WHY?)
  </code></pre>
  
  <p>It seems to behave as if lists are always less than tuples.</p>
  
  <p>This is not what I expected from the <a href="http://docs.python.org/2/reference/expressions.html#not-in" rel="noreferrer">documentation</a></p>
  
  <blockquote>
    <p>Tuples and lists are compared lexicographically using comparison of
    corresponding elements. This means that to compare equal, each element
    must compare equal and the two sequences must be of the same type and
    have the same length.</p>
    
    <p>If not equal, the sequences are ordered the same as their first
    differing elements. For example, cmp([1,2,x], [1,2,y]) returns the
    same as cmp(x,y). If the corresponding element does not exist, the
    shorter sequence is ordered first (for example, [1,2] &lt; [1,2,3]).</p>
  </blockquote>
  
  <h2>QUESTION</h2>
  
  <p>What is going on here?  Am I allowed to compare tuples and lists - or perhaps am I only allowed to compare the same type with itself?</p>