[$] Revisiting NaNs in Python

Post Syndicated from original https://lwn.net/Articles/869231/rss

Back in January 2020, we looked at some
oddities in Python’s handling of Not a Number (NaN) values in
its statistics
module
. The conversation went quiet after that, but it has been
revived recently with an eye toward fixing the problems that were reported.
As detailed in that earlier article, NaNs are rather strange beasts in the
floating-point universe, so figuring out how best to deal with their
presence is less straightforward than it might seem.