mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
Fix trivial typo in json module docstring (GH-2274)
This commit is contained in:
parent
5200a7c7f9
commit
76c567ee27
1 changed files with 1 additions and 1 deletions
|
|
@ -76,7 +76,7 @@ Specializing JSON object encoding::
|
|||
>>> def encode_complex(obj):
|
||||
... if isinstance(obj, complex):
|
||||
... 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)
|
||||
'[2.0, 1.0]'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue