Haoyu SUN <raptor...@gmail.com> added the comment:

Thank you for the timely reply, Eric.

How about we add an optional argument (like the argument "ignore_nan" defaults 
to False as the package simplejson does) to functions like json.dumps(). So 
that user can choose whether he needs NaN encoded as NaN or null, meanwhile the 
default behavior stays the same.

In chromium based browsers, the function JSON.parse cannot parse it correctly. 
Here is an example below:
> JSON.parse('{"a": null, "b": NaN}')
uncaught SyntaxError: Unexpected token N in JSON at position 17
    at JSON.parse (<anonymous>)
    at <anonymous>:1:6

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40633>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to