hjson-py
hjson-py copied to clipboard
floats ending with '.0' turns into ints
This hjson: { test: 1.0 }
turns into {test: 1} after hjson.loads(). A type() call says it is an int. Maybe this is the wanted behavior? I just expected something else. "Normal" json returns a float.
Not sure this is an issue. The serializer here removes the .0
https://hjson.github.io/try.html
However, it is inconsistent with json.tool
.
/tmp
.venv ❯ echo '{"test": 1.0}' | python3 -m json.tool
{
"test": 1.0
}
/tmp
.venv ❯ echo '{"test": 1.0}' | python3 -m hjson.tool
{
test: 1
}