[issue4785] json.JSONDecoder() strict argument undocumented and potentially confusing

Tal Einat report at bugs.python.org
Sat Jun 5 11:18:25 CEST 2010


Tal Einat <taleinat at users.sourceforge.net> added the comment:

Documentation patch attached against py3k branch.

Changes are:

* Added to documentation of JSONDecoder:

If *strict* is ``False`` (``True`` is the default), then control characters will be allowed inside strings.  Control characters in this context are those with character codes in the 0-31 range, including ``'\t'`` (tab), ``'\n'``, ``'\r'`` and ``'\0'``.

* Added clarification in documentation of json.load and json.dump that unless the cls kwarg is specified, the JSONEncoder/JSONDecoder class will be used.

* Mirrored these additions in the relevant doc-strings (JSONDecoder.__init__, json.load, json.loads, json.dump, json.dumps).

* Copied description of the object_pairs_hook kwargs from the documentation to the relevant doc-strings, which otherwise fully mirrored the documentation. (json.load, json.loads, JSONDecoder.__init__)

----------
keywords: +patch
versions: +Python 3.2 -Python 2.6, Python 3.0
Added file: http://bugs.python.org/file17560/json_docs_py3k.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4785>
_______________________________________


More information about the Python-bugs-list mailing list