NaN comparisons - Call For Anecdotes

Steven D'Aprano steve+comp.lang.python at
Tue Jul 8 20:12:38 CEST 2014

On Tue, 08 Jul 2014 20:31:25 +0300, Marko Rauhamaa wrote:

> Thus, dict operations never test NaN == NaN

You're assuming that there is only one NAN instance. That is not correct:

py> a = float('nan')
py> b = float('nan')
py> a is b
py> a in {b: None}


More information about the Python-list mailing list