Skip to content
This repository has been archived by the owner on Feb 26, 2022. It is now read-only.

Commit

Permalink
Docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
richierichrawr committed May 25, 2014
1 parent 1eaec51 commit b4226a7
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions python-lib/simplejson/encoder.py
Expand Up @@ -28,9 +28,10 @@
FLOAT_REPR = repr

def floatstr(o, allow_nan=True):
# Check for specials. Note that this type of test is processor- and/or
# platform-specific, so do tests which don't depend on the internals.

"""
Check for specials. Note that this type of test is processor- and/or
platform-specific, so do tests which don't depend on the internals.
"""
if o != o:
text = 'NaN'
elif o == INFINITY:
Expand Down Expand Up @@ -174,9 +175,15 @@ def __init__(self, skipkeys=False, ensure_ascii=True,
self.encoding = encoding

def _newline_indent(self):
"""
Indent lines by level
"""
return '\n' + (' ' * (self.indent * self.current_indent_level))

def _iterencode_list(self, lst, markers=None):
"""
Encoding lists, yielding by level
"""
if not lst:
yield '[]'
return
Expand Down Expand Up @@ -210,6 +217,9 @@ def _iterencode_list(self, lst, markers=None):
del markers[markerid]

def _iterencode_dict(self, dct, markers=None):
"""
Encoding dictionaries, yielding by level
"""
if not dct:
yield '{}'
return
Expand Down

0 comments on commit b4226a7

Please sign in to comment.