-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-137533: document key type coercion limitations in json.loads
#137545
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
base: main
Are you sure you want to change the base?
Changes from 3 commits
98ba5d5
dcfd3f3
1161ad0
56dfcfd
40d0cd1
9b6732b
8c9d81b
40c5678
541878a
e0dc7eb
1814bfa
f17de69
a4b8240
1a71527
da6e655
3d0b304
d61e84b
96f54a7
9bbdb5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -364,6 +364,14 @@ Basic Usage | |
| .. versionchanged:: 3.9 | ||
| The keyword argument *encoding* has been removed. | ||
|
|
||
| .. note:: | ||
|
|
||
| As mandated by RFC 8259, keys in JSON key-value pairs are always of | ||
|
Rov-Waff marked this conversation as resolved.
Outdated
|
||
| type :class:`str`. Therefore, dictionary keys obtained by | ||
| deserializing JSON objects will always be strings. | ||
| For Example, | ||
| ``json.loads('{"42":"value"}')`` returns the dictionary | ||
| ``{'42': 'value'}``. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't totally see how this example is related to the note. I think it's fine to just have the two sentences without the example.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmmm.this note is for beginners,they may think loads JSON text like |
||
|
|
||
| Encoders and Decoders | ||
| --------------------- | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.