[3.6] Fix trivial typo in json module docstring (GH-2274) (#2430)
(cherry picked from commit 76c567ee27
)
This commit is contained in:
parent
a3ca94d050
commit
48290c1c30
|
@ -76,7 +76,7 @@ Specializing JSON object encoding::
|
||||||
>>> def encode_complex(obj):
|
>>> def encode_complex(obj):
|
||||||
... if isinstance(obj, complex):
|
... if isinstance(obj, complex):
|
||||||
... return [obj.real, obj.imag]
|
... return [obj.real, obj.imag]
|
||||||
... raise TypeError(repr(o) + " is not JSON serializable")
|
... raise TypeError(repr(obj) + " is not JSON serializable")
|
||||||
...
|
...
|
||||||
>>> json.dumps(2 + 1j, default=encode_complex)
|
>>> json.dumps(2 + 1j, default=encode_complex)
|
||||||
'[2.0, 1.0]'
|
'[2.0, 1.0]'
|
||||||
|
|
Loading…
Reference in New Issue