File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -366,14 +366,10 @@ Basic Usage
366366
367367 .. note ::
368368
369- As mandated by :rfc: `8259 `, keys in JSON key-value pairs are always of
370- type :class: `str `. Therefore, dictionary keys obtained by
371- deserializing JSON objects will always be strings.
372- For Example,
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
369+ As mandated by :rfc: `8259 `, JSON keys must be :class: `str ` objects.
370+ In particular, ``json.loads('{"42": "spam"}') `` returns ``{'42': 'spam'} ``,
371+ but ``json.loads('{42: "spam"}') `` fails since ``42 `` is not a valid JSON key.
372+
377373
378374Encoders and Decoders
379375---------------------
You can’t perform that action at this time.
0 commit comments