title: How does interval comparison work?
body: <p>Somehow, this works:</p>
  
  <pre><code>def in_range(min, test, max):
      return min &lt;= test &lt;= max
  
  print in_range(0, 5, 10)  # True
  print in_range(0, 15, 10)  # False
  </code></pre>
  
  <p>However, I can't quite figure out the order of operations here. Let's test the <code>False</code> case:</p>
  
  <pre><code>print 0 &lt;= 15 &lt;= 10  # False
  print (0 &lt;= 15) &lt;= 10  # True
  print 0 &lt;= (15 &lt;= 10)  # True
  </code></pre>
  
  <p>Clearly, this isn't resolving to a simple order of operations issue. Is the interval comparison a special operator, or is something else going on?</p>