summaryrefslogtreecommitdiff
path: root/msgpack/_msgpack.pyx
diff options
context:
space:
mode:
authorINADA Naoki <inada-n@klab.com>2012-09-23 11:22:13 +0900
committerINADA Naoki <inada-n@klab.com>2012-09-23 11:22:13 +0900
commit96ed236c1d53e9ac4f3632ed82f15a1d6e0604da (patch)
tree55ca04faadaf26609ab36630f5a9c255d7f4b1a3 /msgpack/_msgpack.pyx
parent48d693c1b9613fd976a3bf668f692ec22ad4a520 (diff)
parentc3da8458681fc479233910d4c92dc84374e5efed (diff)
downloadmsgpack-python-96ed236c1d53e9ac4f3632ed82f15a1d6e0604da.tar.gz
Merge branch '0.2-maint'
Diffstat (limited to 'msgpack/_msgpack.pyx')
-rw-r--r--msgpack/_msgpack.pyx10
1 files changed, 7 insertions, 3 deletions
diff --git a/msgpack/_msgpack.pyx b/msgpack/_msgpack.pyx
index 8d37aaa..e0a1043 100644
--- a/msgpack/_msgpack.pyx
+++ b/msgpack/_msgpack.pyx
@@ -217,8 +217,10 @@ cdef extern from "unpack.h":
def unpackb(object packed, object object_hook=None, object list_hook=None,
bint use_list=0, encoding=None, unicode_errors="strict",
):
+ """Unpack packed_bytes to object. Returns an unpacked object.
+
+ Raises `ValueError` when `packed` contains extra bytes.
"""
- Unpack packed_bytes to object. Returns an unpacked object."""
cdef template_context ctx
cdef size_t off = 0
cdef int ret
@@ -268,14 +270,16 @@ def unpackb(object packed, object object_hook=None, object list_hook=None,
def unpack(object stream, object object_hook=None, object list_hook=None,
bint use_list=0, encoding=None, unicode_errors="strict",
):
- """
- unpack an object from stream.
+ """Unpack an object from `stream`.
+
+ Raises `ValueError` when `stream` has extra bytes.
"""
return unpackb(stream.read(), use_list=use_list,
object_hook=object_hook, list_hook=list_hook,
encoding=encoding, unicode_errors=unicode_errors,
)
+
cdef class Unpacker(object):
"""
Streaming unpacker.