@@ -217,8 +217,10 @@ cdef extern from "unpack.h":
217217def unpackb (object packed , object object_hook = None , object list_hook = None ,
218218 bint use_list = 0 , encoding = None , unicode_errors = " strict" ,
219219 ):
220+ """ Unpack packed_bytes to object. Returns an unpacked object.
221+
222+ Raises `ValueError` when `packed` contains extra bytes.
220223 """
221- Unpack packed_bytes to object. Returns an unpacked object."""
222224 cdef template_context ctx
223225 cdef size_t off = 0
224226 cdef int ret
@@ -268,14 +270,16 @@ def unpackb(object packed, object object_hook=None, object list_hook=None,
268270def unpack (object stream , object object_hook = None , object list_hook = None ,
269271 bint use_list = 0 , encoding = None , unicode_errors = " strict" ,
270272 ):
271- """
272- unpack an object from stream.
273+ """ Unpack an object from `stream`.
274+
275+ Raises `ValueError` when `stream` has extra bytes.
273276 """
274277 return unpackb(stream.read(), use_list = use_list,
275278 object_hook = object_hook, list_hook = list_hook,
276279 encoding = encoding, unicode_errors = unicode_errors,
277280 )
278281
282+
279283cdef class Unpacker(object ):
280284 """
281285 Streaming unpacker.
0 commit comments