diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-06-21 21:03:20 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-06-21 21:03:20 (GMT) |
commit | aacd53f6cb96fe8c4fe9ce894f22e25f356a97c3 (patch) | |
tree | 4ba936a620bf3170ae9c7f74c35bf52142e40288 /Lib/json/__init__.py | |
parent | 43354375063662deda272b9a2d64cf53d6b748f3 (diff) | |
download | cpython-aacd53f6cb96fe8c4fe9ce894f22e25f356a97c3.zip cpython-aacd53f6cb96fe8c4fe9ce894f22e25f356a97c3.tar.gz cpython-aacd53f6cb96fe8c4fe9ce894f22e25f356a97c3.tar.bz2 |
Issue #18726: All optional parameters of the dump(), dumps(),
load() and loads() functions and JSONEncoder and JSONDecoder class
constructors in the json module are now keyword-only.
Diffstat (limited to 'Lib/json/__init__.py')
-rw-r--r-- | Lib/json/__init__.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/json/__init__.py b/Lib/json/__init__.py index 2612657..28057dd 100644 --- a/Lib/json/__init__.py +++ b/Lib/json/__init__.py @@ -116,7 +116,7 @@ _default_encoder = JSONEncoder( default=None, ) -def dump(obj, fp, skipkeys=False, ensure_ascii=True, check_circular=True, +def dump(obj, fp, *, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, default=None, sort_keys=False, **kw): """Serialize ``obj`` as a JSON formatted stream to ``fp`` (a @@ -179,7 +179,7 @@ def dump(obj, fp, skipkeys=False, ensure_ascii=True, check_circular=True, fp.write(chunk) -def dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True, +def dumps(obj, *, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, default=None, sort_keys=False, **kw): """Serialize ``obj`` to a JSON formatted ``str``. @@ -240,7 +240,7 @@ def dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True, _default_decoder = JSONDecoder(object_hook=None, object_pairs_hook=None) -def load(fp, cls=None, object_hook=None, parse_float=None, +def load(fp, *, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw): """Deserialize ``fp`` (a ``.read()``-supporting file-like object containing a JSON document) to a Python object. @@ -268,7 +268,7 @@ def load(fp, cls=None, object_hook=None, parse_float=None, parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) -def loads(s, encoding=None, cls=None, object_hook=None, parse_float=None, +def loads(s, *, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw): """Deserialize ``s`` (a ``str`` instance containing a JSON document) to a Python object. |