We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3ca94d commit 48290c1Copy full SHA for 48290c1
Lib/json/__init__.py
@@ -76,7 +76,7 @@
76
>>> def encode_complex(obj):
77
... if isinstance(obj, complex):
78
... return [obj.real, obj.imag]
79
- ... raise TypeError(repr(o) + " is not JSON serializable")
+ ... raise TypeError(repr(obj) + " is not JSON serializable")
80
...
81
>>> json.dumps(2 + 1j, default=encode_complex)
82
'[2.0, 1.0]'
0 commit comments