On Sat, 28 Dec 2019 19:31:33 +1100
Chris Angelico <ros...@gmail.com> wrote:
> On Sat, Dec 28, 2019 at 7:03 PM Steve Barnes <gadgetst...@live.co.uk> wrote:
> >
> > Personally I still like the fundamental:
> >
> >
> >
> > def is_nan(num):
> >
> >     “”” Test for NaN “””
> >
> >     return num != num
> >  
> 
> Which was in Steven's original post, and which is dangerous because a
> signalling nan will bomb. There's no easy way to get a safe True/False
> about whether it's nan or not.

Also, it could be inefficient on types which have an expensive __eq__
and didn't implement an identity shortcut.

Regards

Antoine.

_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/FCCPOFGQS7CDDEWTWR6LMQR2NT5J7GT4/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to