Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request option to convert NaN to null instead #1

Open
Duayt opened this issue Oct 10, 2019 · 3 comments
Open

Request option to convert NaN to null instead #1

Duayt opened this issue Oct 10, 2019 · 3 comments

Comments

@Duayt
Copy link

Duayt commented Oct 10, 2019

Request argument option to dumps with null instead of NaN (for future usage krub)

NaN might be an error due to not valid JSON symbol
https://stackoverflow.com/questions/6601812/sending-nan-in-json/6601873

simple json provide this option
https://stackoverflow.com/questions/28639953/python-nan-json-encoder

@piti118
Copy link
Owner

piti118 commented Oct 10, 2019

But nan is not null....

@piti118
Copy link
Owner

piti118 commented Oct 10, 2019

You could workaround like

json_safe_dict = strong_json.to_json_dict(your_obj)
your_favorite_dumper.dump(json_safe_dict)

@Duayt
Copy link
Author

Duayt commented Oct 10, 2019

Ok thank you kub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants