Skip to content
Snippets Groups Projects
Commit 03973eed2321 authored by Dougal Matthews's avatar Dougal Matthews
Browse files

Fixed a typo in the docs

parent c1847083a8ba
Branches
No related tags found
No related merge requests found
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
>>> 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]'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment