NaN comparisons - Call For Anecdotes

Marko Rauhamaa marko at pacujo.net
Tue Jul 8 13:31:25 EDT 2014


Chris Angelico <rosuav at gmail.com>:

> I'd say it would surprise people rather a lot if operations like dict
> insertion/lookup could trigger arithmetic exceptions. :)

That wouldn't trigger exceptions.

Dict operations do an "is" test before an "==" test. In fact, you
couldn't even use NaN as a dict key otherwise. Thus, dict operations
never test NaN == NaN.


Marko



More information about the Python-list mailing list