From: Zackery Spytz Date: Tue, 18 May 2021 21:56:01 +0000 (-0700) Subject: bpo-35765: Clarify references to "object x" in the JSON tutorial (GH-22411) X-Git-Tag: v3.11.0a1~1090 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4fdcc39f711e1b586a94e2c5088fdd7e78fd9f58;p=thirdparty%2FPython%2Fcpython.git bpo-35765: Clarify references to "object x" in the JSON tutorial (GH-22411) --- diff --git a/Doc/tutorial/inputoutput.rst b/Doc/tutorial/inputoutput.rst index 4e27cff83ce5..7f83c4d4612e 100644 --- a/Doc/tutorial/inputoutput.rst +++ b/Doc/tutorial/inputoutput.rst @@ -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`,