]> granicus.if.org Git - python/commitdiff
bpo-30621: Update Input Output Tutorial Example(GH-2074) (GH-2120)
authorMariatta <Mariatta@users.noreply.github.com>
Mon, 12 Jun 2017 01:59:33 +0000 (18:59 -0700)
committerGitHub <noreply@github.com>
Mon, 12 Jun 2017 01:59:33 +0000 (18:59 -0700)
import json before using json module
(cherry picked from commit 1dbce04d0e3e93b715eb0d8024da396361759d16)

Doc/tutorial/inputoutput.rst

index d3542462ef0212e02f200bdb4a767e399042191a..d6c3cb6ac81bafc859d41d0214d5faa0de545c0e 100644 (file)
@@ -390,6 +390,7 @@ sent over a network connection to some distant machine.
 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'])
    '[1, "simple", "list"]'