擅长:python、mysql、java
<p>如果看不到实际输出(或者至少是“额外”行),我们只能猜测。你知道吗</p>
<p>但归根结底还是要看<code>sort</code>做了多少预处理,这比<code>set()</code>找到更多的重复项。你知道吗</p>
<p>可能的原因是</p>
<ul>
<li>某些行上的尾随空格。它们可能被<code>sort</code>移除,但不能被<code>set</code>移除。你知道吗</li>
<li>unicode字符的不同处理。也许sort会将其中一些映射到一组更小的等价物上,从而产生更多的副本。你知道吗</li>
</ul>