cpython: a1884b3027c5 (original) (raw)

Mercurial > cpython

changeset 78824:a1884b3027c5 2.7

#13769: Enhance docs for ensure_ascii semantics in JSON decoding functions [#13769]

Petri Lehtinen petri@digip.org
date Sat, 01 Sep 2012 07:27:58 +0300
parents 62b5667ef2f4
children 2370e331241b
files Doc/library/json.rst Lib/json/__init__.py Lib/json/encoder.py Misc/NEWS
diffstat 4 files changed, 37 insertions(+), 23 deletions(-)[+] [-] Doc/library/json.rst 30 Lib/json/__init__.py 18 Lib/json/encoder.py 9 Misc/NEWS 3

line wrap: on

line diff

--- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -127,11 +127,14 @@ Basic Usage :class:float, :class:bool, None) will be skipped instead of raising a :exc:TypeError.

.. function:: dumps(obj[, skipkeys[, ensure_ascii[, check_circular[, allow_nan[, cls[, indent[, separators[, encoding[, default[, **kw]]]]]]]]]])

@@ -371,9 +374,12 @@ Encoders and Decoders attempt encoding of keys that are not str, int, long, float or None. If skipkeys is True, such items are simply skipped.

--- a/Lib/json/init.py +++ b/Lib/json/init.py @@ -129,11 +129,14 @@ def dump(obj, fp, skipkeys=False, ensure (str, unicode, int, long, float, bool, None) will be skipped instead of raising a TypeError.

If check_circular is false, then the circular reference check for container types will be skipped and a circular reference will @@ -191,9 +194,8 @@ def dumps(obj, skipkeys=False, ensure_as (str, unicode, int, long, float, bool, None) will be skipped instead of raising a TypeError.

If check_circular is false, then the circular reference check for container types will be skipped and a circular reference will

--- a/Lib/json/encoder.py +++ b/Lib/json/encoder.py @@ -107,9 +107,12 @@ class JSONEncoder(object): encoding of keys that are not str, int, long, float or None. If skipkeys is True, such items are simply skipped.

If check_circular is true, then lists, dicts, and custom encoded objects will be checked for circular references during encoding to

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -393,6 +393,9 @@ Build Documentation ------------- +- Issue #13769: Document the effect of ensure_ascii to the return type