
March 24, 2010
5:36 a.m.
Steven D'Aprano writes:
As usual though, NANs are unintuitive:
d = {float('nan'): 1} d[float('nan')] = 2 d {nan: 1, nan: 2}
I suspect that's a feature, not a bug.
I don't see how it can be so. Aren't all of those entries garbage? To compute a histogram of results for computations on a series of cases would you not have to test each result for NaN-hood, then hash on a proxy such as the string "Nan"?