Revert "Move unpack() from each implementation to __init__. (#286)"

This reverts commit da902f9c1d.
This commit is contained in:
INADA Naoki 2018-02-23 11:32:26 +09:00 committed by GitHub
parent 9bf38105f7
commit 9455fccc52
3 changed files with 39 additions and 14 deletions

View file

@ -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):
"""