Skip to content

Commit 40d0cd1

Browse files
committed
gh-137533:make up more example to explain json.loads
1 parent 56dfcfd commit 40d0cd1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Doc/library/json.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,10 @@ Basic Usage
370370
type :class:`str`. Therefore, dictionary keys obtained by
371371
deserializing JSON objects will always be strings.
372372
For Example,
373-
``json.loads('{"42":"value"}')`` returns the dictionary
374-
``{'42': 'value'}``.
373+
``json.loads('{"42":"spam"}')`` returns the dictionary
374+
``{'42': 'spam'}`,but ``json.loads('{42:"spam"}')``
375+
will raise a exception,because it is not a correct
376+
JSON text
375377

376378
Encoders and Decoders
377379
---------------------

0 commit comments

Comments
 (0)