@nedbat huh, the case of float("inf") producing unambiguously-wrong JSON is bizarre. Historical artifact of supporting web applications sending stuff to JS?
The only filed bug I can find about it¹ seems to be more concerned with being able to serialize NaN to null.
The unfortunately-named allow_nan
parameter at least turns that into an exception, but I can't recall the last time I saw code that cared to set it.
¹ https://github.com/python/cpython/issues/98306
=> More informations about this toot | View the thread | More toots from SnoopJ@hachyderm.io
=> View nedbat@hachyderm.io profile
text/gemini
This content has been proxied by September (ba2dc).