On Wed, Jun 17, 2020 at 10:43 AM Steven D'Aprano <st...@pearwood.info> wrote:
>
> 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
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/YK7KCKQV74RU66G4E6DLSLIK7OCT27EZ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to