3 ms·
One more thing that really bugs me about JSON is that it doesn't support Infinity, -Infinity and NaN. Python's JSON library does, which leads to some interestin
by beatgammit 14y ago
One more thing that really bugs me about JSON is that it doesn't support Infinity, -Infinity and NaN. Python's JSON library does, which leads to some interesting breakages.
Sure, for NaN you can use null, but for Infinity, you have to use really large/small numbers, which can also lead to other problems.
- udp 14y agoIf Python's JSON library accepts Infinity by default, that's a bug and should be reported.
- enaeseth 14y agoYou can try to report it as a bug, but the docs indicate that this is by design.
- JulianWasTaken 14y agoIt isn't. It's documented behavior. See http://docs.python.org/2/library/json.html http://docs.python.org/2/library/json.html. (simple)JSON deviates from the spec in a few minor ways.
- andrewcooke 14y agomore exactly, it's an option you can disable.
- Mooby 14y agoThat isn't JSON's problem. It's your app's problem. Set your parser to recognize "Infinity" as a token and you are set.