summaryrefslogtreecommitdiff
path: root/frontend/afe/simplejson/encoder.py
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/afe/simplejson/encoder.py')
-rw-r--r--frontend/afe/simplejson/encoder.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/frontend/afe/simplejson/encoder.py b/frontend/afe/simplejson/encoder.py
index c83c6873..5271f6be 100644
--- a/frontend/afe/simplejson/encoder.py
+++ b/frontend/afe/simplejson/encoder.py
@@ -58,14 +58,14 @@ def encode_basestring_ascii(s):
except KeyError:
return '\\u%04x' % (ord(s),)
return '"' + str(ESCAPE_ASCII.sub(replace, s)) + '"'
-
+
class JSONEncoder(object):
"""
Extensible JSON <http://json.org> encoder for Python data structures.
Supports the following objects and types by default:
-
+
+-------------------+---------------+
| Python | JSON |
+===================+===============+
@@ -287,7 +287,7 @@ class JSONEncoder(object):
For example, to support arbitrary iterators, you could
implement default like this::
-
+
def default(self, o):
try:
iterable = iter(o)
@@ -316,9 +316,9 @@ class JSONEncoder(object):
"""
Encode the given object and yield each string
representation as available.
-
+
For example::
-
+
for chunk in JSONEncoder().iterencode(bigobject):
mysocket.write(chunk)
"""