mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-35765: Clarify references to "object x" in the JSON tutorial (GH-22411) (GH-26218)
(cherry picked from commit 4fdcc39f71
)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
This commit is contained in:
parent
e57bef1b73
commit
5f2afff1dd
1 changed files with 2 additions and 1 deletions
|
@ -480,7 +480,8 @@ If you have an object ``x``, you can view its JSON string representation with a
|
|||
simple line of code::
|
||||
|
||||
>>> import json
|
||||
>>> json.dumps([1, 'simple', 'list'])
|
||||
>>> x = [1, 'simple', 'list']
|
||||
>>> json.dumps(x)
|
||||
'[1, "simple", "list"]'
|
||||
|
||||
Another variant of the :func:`~json.dumps` function, called :func:`~json.dump`,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue