]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-35765: Clarify references to "object x" in the JSON tutorial (GH-22411) (GH-26219)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 19 May 2021 08:59:36 +0000 (01:59 -0700)
committerGitHub <noreply@github.com>
Wed, 19 May 2021 08:59:36 +0000 (09:59 +0100)
(cherry picked from commit 4fdcc39f711e1b586a94e2c5088fdd7e78fd9f58)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Doc/tutorial/inputoutput.rst

index 4e27cff83ce59fcd87f38aafc9d7120970bcdb0d..7f83c4d4612eb351fc8f7704e71e89914c831a10 100644 (file)
@@ -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`,