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

Fixes #285
This commit is contained in:
INADA Naoki 2018-02-22 00:55:32 +09:00 committed by GitHub
parent ae8d469482
commit da902f9c1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 39 deletions

View file

@ -100,16 +100,6 @@ 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):
"""