summaryrefslogtreecommitdiff
path: root/index.rst
diff options
context:
space:
mode:
Diffstat (limited to 'index.rst')
-rw-r--r--index.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/index.rst b/index.rst
index 41133c0..0bc8577 100644
--- a/index.rst
+++ b/index.rst
@@ -85,7 +85,7 @@ Specializing JSON object encoding::
>>> def encode_complex(obj):
... if isinstance(obj, complex):
... return [obj.real, obj.imag]
- ... raise TypeError("%r is not JSON serializable" % (o,))
+ ... raise TypeError(repr(o) + " is not JSON serializable")
...
>>> json.dumps(2 + 1j, default=encode_complex)
'[2.0, 1.0]'