A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-November/093976.html below:

[Python-Dev] decimal.py: == and != comparisons involving NaNs

[Python-Dev] decimal.py: == and != comparisons involving NaNs [Python-Dev] decimal.py: == and != comparisons involving NaNsTerry Reedy tjreedy at udel.edu
Mon Nov 9 23:51:09 CET 2009
Mark Dickinson wrote:

> That's because you're creating two different float nans.
> Compare with:
> 
> Python 3.2a0 (py3k:76132M, Nov  6 2009, 14:47:39)
> [GCC 4.2.1 (SUSE Linux)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> nan = float('nan')
>>>> d = {nan: 10, 0: 20}
>>>> nan in d
> True
>>>> d[nan]
> 10

This also suggests to me that nan should be a singleton, or at least 
that the doc should recommend that programs should make it be such for 
the program.

tjr

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4