-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
update json module docs in light of RFC 7159 & ECMA-404 #65713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
json module docs: https://docs.python.org/3/library/json.html New superseding JSON RFC: https://tools.ietf.org/html/rfc7159 These updated specs are of particular relevance to the Standard Compliance section of the json module docs. There are also a bunch of new interoperability notes in the RFC that could probably bear repeating in the module's docs. |
Here's a draft patch against the default branch that updates the json module's docs accordingly. Note that under "Implementation Limitations", the statement "This module does not impose any such limits beyond those of the relevant Python datatypes themselves or the Python interpreter itself." is just a guess; I need someone who's familiar with the implementation to verify/correct this. |
This patch looks reasonable to me as-is. With regard to "Infinite and NaN number values are accepted and output;" there's an option for that (allow_nan=False in encoding, parse_constant=some_function_that_raises in decoding). Since an exception can't be raised in a lambda there's no simple one-liner to ensure compliant decode. |
Thanks for the speedy review! Those NaN-related arguments are already mentioned in the docs (see last 2 sentences of https://docs.python.org/3/library/json.html#infinite-and-nan-number-values ), and this patch doesn't touch that subsection. |
Good call, I was just doing a quick review of the patch in isolation. Now I don't have anything at all to comment on :) |
Thanks Bob. If you want me to apply the patch, just assign this back to me. |
So, when might I expect to see this patch merged, since it's now been approved? |
Soonish. |
Ping! It's been about 3 months since this was given the green light... |
Serhiy, can you take this one. The patch passes both mine and Bob's review; however, it doesn't apply cleanly to 2.7 and 3.4. I haven't had the time to do the needed backports. |
New changeset 7e534e18a99a by Serhiy Storchaka in branch '2.7': New changeset 89bb4384f1e1 by Serhiy Storchaka in branch '3.4': New changeset aced2548345a by Serhiy Storchaka in branch 'default': |
Thanks Serhiy! |
Thank you Chris for your patch. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: