title: NaNs as key in dictionaries
body: <p>Can anyone explain the following behaviour to me?</p>
  
  <pre><code>&gt;&gt;&gt; import numpy as np
  &gt;&gt;&gt; {np.nan: 5}[np.nan]
  5
  &gt;&gt;&gt; {float64(np.nan): 5}[float64(np.nan)]
  KeyError: nan
  </code></pre>
  
  <p>Why does it work in the first case, but not in the second?
  Additionally, I found that the following DOES work:</p>
  
  <pre><code>&gt;&gt;&gt; a ={a: 5}[a]
  float64(np.nan)
  </code></pre>