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/2010-March/098856.html below:

[Python-Dev] Why is nan != nan?

[Python-Dev] Why is nan != nan?Mark Dickinson dickinsm at gmail.com
Wed Mar 24 23:47:42 CET 2010
On Wed, Mar 24, 2010 at 10:36 PM, Alexander Belopolsky
<alexander.belopolsky at gmail.com> wrote:
> On Wed, Mar 24, 2010 at 6:31 PM, Mark Dickinson <dickinsm at gmail.com> wrote:
> ..
>> Neither is necessary, because Python doesn't actually use == as the
>> equivalence relation for containment testing:  the actual equivalence
>> relation is:  x equivalent to y iff id(x) == id(y) or x == y.  This
>> restores the missing reflexivity (besides being a useful
>> optimization).
>
> No, it does not:
>
>>>> float('nan') in [float('nan')]
> False

Sure, but just think of it as having two different nans there.  (You
could imagine thinking of the id of the nan as part of the payload.)
There's no ideal solution here;  IMO, the compromise that currently
exists is an acceptable one.

Mark
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