[Python-ideas] checking for identity before comparing built-in objects
Mark Dickinson
dickinsm at gmail.com
Tue Oct 9 08:43:57 CEST 2012
On Mon, Oct 8, 2012 at 9:39 PM, Ned Batchelder <ned at nedbatchelder.com> wrote:
> How about:
>
> "In accordance with the IEEE 754 standard, when NaNs are compared to any
> value, even another NaN, the result is always False, regardless of the
> comparison. This is because NaN represents an unknown result. There is no
> way to know the relationship between an unknown result and any other result,
> especially another unknown one. Even comparing a NaN to itself always
> produces False."
Looks fine, but I'd suggest leaving out the philosophy ('there is no
way to know ...') and sticking to the statement that Python follows
the IEEE 754 standard in this respect. The justification isn't
particularly convincing and (IMO) only serves to invite arguments.
--
Mark
More information about the Python-ideas
mailing list