
March 27, 2010
4:46 p.m.
Marcin 'Qrczak' Kowalczyk writes:
The original problem with NaN is a consequence of an unfortunate decision to unify numeric equality with object equivalence. If they were distinguished, their behavior would be obvious: NaN != NaN NaN eq NaN
What do you mean by that? NaN is a class, not an instance!
0.0 == -0.0 0.0 ne -0.0 42 == 42.0 42 ne 42.0
As for the other examples, I can only sigh, 'Ah, the joys of "general abstract nonsense".'[1] I have some (abstract) sympathy for Mark's proposal for a with_nonstop_arithmetic context manager, but isn't it really a YAGNI for the Python language? (As opposed to high performance modules like numpy.) Footnotes: [1] I refer to Bourbaki's(?) name for category theory.