title: Multiple comparison operators in single statement (chaining comparison operators)
body: <p>Does this do what I think it does?</p>
  
  <pre><code>assert 1 &lt; 2 &lt; 3
  </code></pre>
  
  <p>I couldn't find any reference to this in <a href="https://docs.python.org/3/library/stdtypes.html#comparisons" rel="noreferrer">the docs</a> but I saw it in a high rep <a href="https://stackoverflow.com/a/16424639/4653485">answer</a>.</p>
  
  <p>It seems to work but it could be luck, like the leftmost resolves to <code>True</code>, then <code>True</code> is used in the other.</p>
  
  <p>I did a few tests and it always work as expected, but I'd like to find a source (a doc) stating explicitly that it is intended.</p>
  
  <pre><code>&gt;&gt;&gt; 1&lt;2&lt;3&lt;4&lt;5
  True
  &gt;&gt;&gt; 1&lt;2&lt;7&lt;4&lt;5
  False
  &gt;&gt;&gt; 1&lt;2&lt;3&gt;2&lt;5
  True
  </code></pre>
  
  <p>This rules out the "leftmost first" hypothesis:</p>
  
  <pre><code>&gt;&gt;&gt; 1&lt;3&lt;2
  False
  &gt;&gt;&gt; (1&lt;3)&lt;2
  True
  </code></pre>