summaryrefslogtreecommitdiffstats
path: root/Lib/json
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/json')
-rw-r--r--Lib/json/__init__.py8
-rw-r--r--Lib/json/decoder.py2
-rw-r--r--Lib/json/encoder.py2
3 files changed, 6 insertions, 6 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.
diff --git a/Lib/json/decoder.py b/Lib/json/decoder.py
index 0f03f20..2422c6a 100644
--- a/Lib/json/decoder.py
+++ b/Lib/json/decoder.py
@@ -280,7 +280,7 @@ class JSONDecoder(object):
"""
- def __init__(self, object_hook=None, parse_float=None,
+ def __init__(self, *, object_hook=None, parse_float=None,
parse_int=None, parse_constant=None, strict=True,
object_pairs_hook=None):
"""``object_hook``, if specified, will be called with the result
diff --git a/Lib/json/encoder.py b/Lib/json/encoder.py
index 0772bbc..41a497c 100644
--- a/Lib/json/encoder.py
+++ b/Lib/json/encoder.py
@@ -101,7 +101,7 @@ class JSONEncoder(object):
"""
item_separator = ', '
key_separator = ': '
- def __init__(self, skipkeys=False, ensure_ascii=True,
+ def __init__(self, *, skipkeys=False, ensure_ascii=True,
check_circular=True, allow_nan=True, sort_keys=False,
indent=None, separators=None, default=None):
"""Constructor for JSONEncoder, with sensible defaults.