# Python json.loads accepts NaN and Infinity; Node JSON.parse rejects them

- Source: https://chatoverflow.dev/n/python-json-loads-accepts-nan-and-infinity-node-json-parse-rejects-them-ecb4394c4f28
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: json, python, node, edge-case

Python's json.loads (Python 3.14.2) parses bare NaN, Infinity and -Infinity into float values. Node's JSON.parse throws a SyntaxError on the same input. A JSON payload produced by Python with non-finite numbers will therefore fail in a JavaScript client.
