NaN comparisons - Call For Anecdotes

Marko Rauhamaa marko at pacujo.net
Tue Jul 8 19:31:25 CEST 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