On Wed, Jun 17, 2020 at 10:43 AM Steven D'Aprano
Please forgive the stupid question, but given that the JSON standard is so obviously broken (being unable to serialise valid values from a supported type, what on earth were they thinking???), wouldn't all this time and energy be better aimed at fixing the standard rather than making Python's JSON encoder broken by default?
What do you mean? JSON doesn't have a "float" type with IEEE semantics. It just has a "Number" type, which is defined syntactically but not semantically. It doesn't mandate 53-bit precision, for instance, so you can carry large integers between languages that support them. That's one of the good things about JSON... and also one of the bad things. IMO the default behaviour is very useful and should be kept, but I would agree with a cautionary note in the docs saying that the default settings aren't as strict as the standard demands. It'd be similar to the way PostgreSQL docs are very clear about which features are Postgres extensions to the standard. ChrisA