This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author niacdoial
Recipients niacdoial
Date 2016-11-01.15:00:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1478012437.7.0.981813738405.issue28579@psf.upfronthosting.co.za>
In-reply-to
Content
I found a really weird comportment with NANs:

>>> from math import nan, isnan, inf
>>> nan==nan
False
>>> nan!=nan
True
>>> a=nan  # maybe get another instance would fix it (or so I thought)
>>> a==nan
False
>>> a==a
False
>>> a is a  
True
>>> # because `is` works, it could be a
>>> # deliberate comportment. is it?
>>> a is nan
True
>>> isnan(a) and isnan(nan)
True
>>> nan == -nan
False
>>> nan is -nan
False
>>> a < 1
False
>>> a > 0
False
>>> a < inf
False
>>> b=external_pyd_call_that_returns_nan()
>>> isnan(b)
True
>>> b == nan
False

that sums what I tried up.

thanks for reading this.
History
Date User Action Args
2016-11-01 15:00:37niacdoialsetrecipients: + niacdoial
2016-11-01 15:00:37niacdoialsetmessageid: <1478012437.7.0.981813738405.issue28579@psf.upfronthosting.co.za>
2016-11-01 15:00:37niacdoiallinkissue28579 messages
2016-11-01 15:00:37niacdoialcreate