From: Kit Sunde Date: Mon, 10 Jul 2017 20:05:25 +0000 (+0800) Subject: json Docs: Trivial update to the code example (GH-2465) X-Git-Tag: v2.7.14rc1~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d1554a2eb00938f3d5a3e18b6244dd023fc9339;p=thirdparty%2FPython%2Fcpython.git json Docs: Trivial update to the code example (GH-2465) Replace `dumps` with `json.dumps` --- diff --git a/Doc/library/json.rst b/Doc/library/json.rst index c4d5ee6ec175..87dc0541dc7f 100644 --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -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]'