summaryrefslogtreecommitdiff
path: root/msgpack/fallback.py
diff options
context:
space:
mode:
authorINADA Naoki <methane@users.noreply.github.com>2018-02-23 11:33:26 +0900
committerGitHub <noreply@github.com>2018-02-23 11:33:26 +0900
commit3ca8eff31dd1a8a6c867f2d490f8ca26cb840124 (patch)
treeb96cce5d71c066f2cc4deee741b3a19f3b4ed1e4 /msgpack/fallback.py
parent02c881c7cb402b37418a9bd9a3fa56daf673a71b (diff)
parent9455fccc5283abe59868c55ee3f4cedd5bf2d14b (diff)
downloadmsgpack-python-3ca8eff31dd1a8a6c867f2d490f8ca26cb840124.tar.gz
Revert "Move unpack() from each implementation to __init__." (#288)
This reverts commit da902f9c1d996fb461f1efef6487ef40d32d365a.
Diffstat (limited to 'msgpack/fallback.py')
-rw-r--r--msgpack/fallback.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/msgpack/fallback.py b/msgpack/fallback.py
index 3609fd8..7e40686 100644
--- a/msgpack/fallback.py
+++ b/msgpack/fallback.py
@@ -100,6 +100,16 @@ def _get_data_from_buffer(obj):
return view
+def unpack(stream, **kwargs):
+ """
+ Unpack an object from `stream`.
+
+ Raises `ExtraData` when `packed` contains extra bytes.
+ See :class:`Unpacker` for options.
+ """
+ data = stream.read()
+ return unpackb(data, **kwargs)
+
def unpackb(packed, **kwargs):
"""