summaryrefslogtreecommitdiffstats
path: root/Lib/pickle.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2020-05-02 06:38:01 (GMT)
committerGitHub <noreply@github.com>2020-05-02 06:38:01 (GMT)
commit531d1e541284bfd7944f8c66a5e8c3c3234afaff (patch)
tree877a425117074ca43bc46db97a145a53f34dcebb /Lib/pickle.py
parentd2baff4301387e232495491f7291903cc1217d21 (diff)
downloadcpython-531d1e541284bfd7944f8c66a5e8c3c3234afaff.zip
cpython-531d1e541284bfd7944f8c66a5e8c3c3234afaff.tar.gz
cpython-531d1e541284bfd7944f8c66a5e8c3c3234afaff.tar.bz2
bpo-39435: Make the first argument of pickle.loads() positional-only. (GH-19846)
It was positional-only de facto: documentation and two implementations used three different name.
Diffstat (limited to 'Lib/pickle.py')
-rw-r--r--Lib/pickle.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py
index 1fc8b0d..cbac5f1 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -13,7 +13,7 @@ Functions:
dump(object, file)
dumps(object) -> string
load(file) -> object
- loads(string) -> object
+ loads(bytes) -> object
Misc variables:
@@ -1761,7 +1761,7 @@ def _load(file, *, fix_imports=True, encoding="ASCII", errors="strict",
return _Unpickler(file, fix_imports=fix_imports, buffers=buffers,
encoding=encoding, errors=errors).load()
-def _loads(s, *, fix_imports=True, encoding="ASCII", errors="strict",
+def _loads(s, /, *, fix_imports=True, encoding="ASCII", errors="strict",
buffers=None):
if isinstance(s, str):
raise TypeError("Can't load pickle from unicode string")