<p>这里发生了几件事:</p>
<ul>
<li><strong>any()函数</li>
</ul>
<blockquote>
<p><a href="https://beginnersbook.com/2019/03/python-any-function/" rel="nofollow noreferrer">https://beginnersbook.com/2019/03/python-any-function/</a></p>
<p>Python any() function accepts iterable (list, tuple, dictionary etc.)
as an argument and return true if any of the element in iterable is
true, else it returns false. If iterable is empty then any() method
returns false.</p>
</blockquote>
<ul>
<li><strong>Python iterable</strong></li>
</ul>
<blockquote>
<p><a href="https://www.pythonlikeyoumeanit.com/Module2_EssentialsOfPython/Iterables.html" rel="nofollow noreferrer">https://www.pythonlikeyoumeanit.com/Module2_EssentialsOfPython/Iterables.html</a></p>
<p>An iterable is any Python object capable of returning its members one
at a time, permitting it to be iterated over in a for-loop.</p>
</blockquote>
<ul>
<li><p><strong>函数的返回值:</strong><code>any(node.state == state for node in self.frontier)</code></p>
<p>如果列表“self.frontier”中的任何“节点”中的“note.value”与输入参数“state”的值相同,则返回“true”</p></li>
</ul>
<p>我希望这有助于</p>