Is nan in (nan,) correct?

Chris Angelico rosuav at gmail.com
Thu Mar 5 18:40:19 EST 2015


On Fri, Mar 6, 2015 at 10:27 AM,  <sohcahtoa82 at gmail.com> wrote:
> Do you have an example of where `a is b` but `a != b` in Python?  `None == None` is True.

Check out the subject line.

>>> nan = float("nan")
>>> nan is nan  # obviously
True
>>> nan != nan  # IEEE 754 mandates
True

ChrisA



More information about the Python-list mailing list