Skip to content

Commit 98ba5d5

Browse files
committed
gh-137533:Add a note under function:: loads() to Improve visibility of key type coercion limitation in json module docs
1 parent f06fcb7 commit 98ba5d5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Doc/library/json.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@ Basic Usage
364364
.. versionchanged:: 3.9
365365
The keyword argument *encoding* has been removed.
366366

367+
.. note::
368+
369+
As mandated by RFC 8259,the key in key-value pairs in JSON is always of type of :class:`str`,so the key of the dictionary that is got by serializing a JSON object is always a string.
370+
Example:``json.loads('{"42":"value"}')`` will get a dictionary ``{'42':'value'}``
367371

368372
Encoders and Decoders
369373
---------------------

0 commit comments

Comments
 (0)