<p>I'm shocked! <a href="https://ciberlandia.pt/tags/TodayILearned" class="mention hashtag" rel="tag">#<span>TodayILearned</span></a> that <a href="https://ciberlandia.pt/tags/Python" class="mention hashtag" rel="tag">#<span>Python</span></a> sets don't de-duplicate NaN values! (I guess it is because NaN has this crazy property that it is not equal to itself... NaN != NaN is True...) </p><pre><code>>>> set((float('nan'), float('nan'), float('nan'))) <br>{nan, nan, nan}<br></code></pre>