擅长:python、mysql、java
<p>你的一行相当于这两个ifs:</p>
<pre><code>if fsa:
fsa = union(fsa, fsa2):
if not fsa:
fsa = fsa2
</code></pre>
<p>这种使用布尔运算符的方式(<code>fsa = (fsa and union(fsa, fsa2)) or fsa2</code>)称为短路</strong>。在</p>
<p>在<a href="http://docs.python.org/2/library/stdtypes.html#boolean-operations-and-or-not" rel="nofollow noreferrer">python docs</a>中有一些信息和相关问题,例如:<a href="https://stackoverflow.com/questions/2580136/does-python-support-short-circuiting">Does Python support short-circuiting?</a></p>