summaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
authorSpiros Eliopoulos <seliopou@gmail.com>2012-11-01 00:55:33 -0400
committerSpiros Eliopoulos <seliopou@gmail.com>2012-11-01 00:55:33 -0400
commit30233a5a995e23b72319598d11ebba084497a18b (patch)
tree2974b4ff7f014fadb686134ccb5b3e33410e7d6c /README.rst
parent62e8f400244a449ab4ca72991ae8f06610298dc6 (diff)
downloadmsgpack-python-30233a5a995e23b72319598d11ebba084497a18b.tar.gz
Fix Unpacker example in README
The example did not properly deserialize, since it was dropping bytes from the input stream.
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst13
1 files changed, 7 insertions, 6 deletions
diff --git a/README.rst b/README.rst
index bcfd98c..c15d46b 100644
--- a/README.rst
+++ b/README.rst
@@ -52,14 +52,15 @@ stream.
buf.seek(0)
- unpacker = msgpack.Unpacker()
- while True:
- data = buf.read(4)
+ unpacker = msgpack.Unpacker()
+ while True:
+ data = buf.read(16)
if not data:
break
- unpacker.feed(buf.read(16))
- for unpacked in unpacker:
- print unpacked
+ unpacker.feed(data)
+
+ for unpacked in unpacker:
+ print unpacked
packing/unpacking of custom data type
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^