What is this kind of chain assignment and comparison in python?
<p>(Python 2.7 question)</p>

<p>I found a pattern similar to the following in a python codebase:</p>

<pre><code>&gt;&gt;&gt; a = b == 7
&gt;&gt;&gt; a
True
&gt;&gt;&gt; b
7
&gt;&gt;&gt; a = b == -7
&gt;&gt;&gt; a
False
&gt;&gt;&gt; b
7
</code></pre>

<p>I'm looking for the terminology for this - I found some other answers that referred to (a = b = 7) as "chain assignment". What is the format (a = b == 7) called?</p>

<p><code>b == 7</code> is comparison for equality. The result of a comparison is a boolean value that is assigned to <code>a</code>.</p>

python python-2.7