Remove trailing whitespace.
diff --git a/Doc/library/json.rst b/Doc/library/json.rst
index 5fb8498..8a644af 100644
--- a/Doc/library/json.rst
+++ b/Doc/library/json.rst
@@ -14,7 +14,7 @@
:mod:`marshal` and :mod:`pickle` modules.
Encoding basic Python object hierarchies::
-
+
>>> import json
>>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])
'["foo", {"bar": ["baz", null, 1.0, 2]}]'
@@ -43,12 +43,12 @@
>>> import json
>>> print json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4)
{
- "4": 5,
+ "4": 5,
"6": 7
}
Decoding JSON::
-
+
>>> import json
>>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]')
[u'foo', {u'bar': [u'baz', None, 1.0, 2]}]
@@ -66,7 +66,7 @@
... if '__complex__' in dct:
... return complex(dct['real'], dct['imag'])
... return dct
- ...
+ ...
>>> json.loads('{"__complex__": true, "real": 1, "imag": 2}',
... object_hook=as_complex)
(1+2j)
@@ -75,26 +75,26 @@
Decimal('1.1')
Extending :class:`JSONEncoder`::
-
+
>>> import json
>>> class ComplexEncoder(json.JSONEncoder):
... def default(self, obj):
... if isinstance(obj, complex):
... return [obj.real, obj.imag]
... return json.JSONEncoder.default(self, obj)
- ...
+ ...
>>> dumps(2 + 1j, cls=ComplexEncoder)
'[2.0, 1.0]'
>>> ComplexEncoder().encode(2 + 1j)
'[2.0, 1.0]'
>>> list(ComplexEncoder().iterencode(2 + 1j))
['[', '2.0', ', ', '1.0', ']']
-
+
.. highlight:: none
Using json.tool from the shell to validate and pretty-print::
-
+
$ echo '{"json":"obj"}' | python -mjson.tool
{
"json": "obj"
@@ -104,7 +104,7 @@
.. highlight:: python
-.. note::
+.. note::
The JSON produced by this module's default settings is a subset of
YAML, so it may be used as a serializer for that as well.
@@ -368,7 +368,7 @@
For example, to support arbitrary iterators, you could implement default
like this::
-
+
def default(self, o):
try:
iterable = iter(o)
@@ -392,6 +392,6 @@
Encode the given object, *o*, and yield each string representation as
available. For example::
-
+
for chunk in JSONEncoder().iterencode(bigobject):
mysocket.write(chunk)