]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
json Docs: Trivial update to the code example (GH-2465)
authorKit Sunde <kitsunde@gmail.com>
Mon, 10 Jul 2017 20:05:25 +0000 (04:05 +0800)
committerMariatta <Mariatta@users.noreply.github.com>
Mon, 10 Jul 2017 20:05:25 +0000 (13:05 -0700)
Replace `dumps` with `json.dumps`

Doc/library/json.rst

index c4d5ee6ec175be2f936f38a43d9538990c0b203f..87dc0541dc7f1c8a450cf72a056af2a83ca3d1d2 100644 (file)
@@ -89,7 +89,7 @@ Extending :class:`JSONEncoder`::
     ...         # Let the base class default method raise the TypeError
     ...         return json.JSONEncoder.default(self, obj)
     ...
-    >>> dumps(2 + 1j, cls=ComplexEncoder)
+    >>> json.dumps(2 + 1j, cls=ComplexEncoder)
     '[2.0, 1.0]'
     >>> ComplexEncoder().encode(2 + 1j)
     '[2.0, 1.0]'