common.py makes sure to check whether the decimal 1.0 == int(1.0), return 1 if that is the case. Values sent as 1.0 over the wire show up as 1 in Python. I get that this might in some cases be considered a feature, and JSON makes no explicit distinction between integers and floats, but this is causing issues for round trip (de)serializations.
For reference, Python's default json.loads()does parse ["1.0", 1.0, 1] as-is, where ijson parses it as ["1.0", 1, 1]. Should this behaviour not be either configurable or compatible with the default lib?
common.py
makes sure to check whether the decimal1.0 == int(1.0)
, return1
if that is the case. Values sent as1.0
over the wire show up as1
in Python. I get that this might in some cases be considered a feature, and JSON makes no explicit distinction between integers and floats, but this is causing issues for round trip (de)serializations.For reference, Python's default
json.loads()
does parse["1.0", 1.0, 1]
as-is, whereijson
parses it as["1.0", 1, 1]
. Should this behaviour not be either configurable or compatible with the default lib?