➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mitar
Recipients mitar
Date 2019-05-07.20:32:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <[email protected]>
In-reply-to
Content
Currently, there is only one argument which allows customization how float numbers are encoded in JSON: allow_nan. But this does not allow one to hook into the encoding of floating points really. The JSONEncoder is not called for float numbers.

The motivation here is that we would like to encode NaN and Infinity values differently, instead of non-standard approach and instead of raising an exception.

The "load" counterpart has "parse_float" which one can use to hook into parsing floats. I would suggest something similar, maybe "encode_float" which if provided would be used instead of the default.
History
Date User Action Args
2019-05-07 20:32:33mitarsetrecipients: + mitar
2019-05-07 20:32:33mitarsetmessageid: <[email protected]>
2019-05-07 20:32:33mitarlinkissue36841 messages
2019-05-07 20:32:33mitarcreate