[issue40633] json.dumps() should encode float number NaN to null

Mark Dickinson report at bugs.python.org
Fri Nov 20 13:06:35 EST 2020


Mark Dickinson <dickinsm at gmail.com> added the comment:

@Arjan Staring: could you point to which part of the JSON specification you're looking at?

At https://tools.ietf.org/html/rfc7159, the only reference to NaNs that I see is:

> Numeric values that cannot be represented in the grammar below (such
> as Infinity and NaN) are not permitted.

At https://www.json.org/json-en.html, there's no mention of IEEE 754 special values.

I'm not seeing anything anywhere to suggest that the JSON specification says NaNs should be translated to nulls.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40633>
_______________________________________


More information about the Python-bugs-list mailing list