diff options
author | INADA Naoki <songofacandy@gmail.com> | 2012-12-06 18:23:04 -0800 |
---|---|---|
committer | INADA Naoki <songofacandy@gmail.com> | 2012-12-06 18:23:04 -0800 |
commit | f8d7dea762290c1e61ff4365bcd7a374a09679d5 (patch) | |
tree | 95037be3d7aa8a64f6ce7c44ece5ec069cd4c991 /README.rst | |
parent | 4d844df492c84c5ddd9f725e493900ce6f4eecc5 (diff) | |
parent | edd2e52373246c7d55ee59bf3bd46cda60e3be6d (diff) | |
download | msgpack-python-f8d7dea762290c1e61ff4365bcd7a374a09679d5.tar.gz |
Merge pull request #35 from jnothman/patch-1
Fix README re default use_list=True
Diffstat (limited to 'README.rst')
-rw-r--r-- | README.rst | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -29,21 +29,20 @@ msgpack provides ``dumps`` and ``loads`` as alias for compatibility with ``pack`` and ``dump`` packs to file-like object. ``unpack`` and ``load`` unpacks from file-like object. +:: + >>> import msgpack >>> msgpack.packb([1, 2, 3]) '\x93\x01\x02\x03' >>> msgpack.unpackb(_) - (1, 2, 3) - + [1, 2, 3] -``unpack`` unpacks msgpack's array to Python's tuple. -To unpack it to list, Use ``use_list`` option. +``unpack`` unpacks msgpack's array to Python's list, but can unpack to tuple:: - >>> msgpack.unpackb(b'\x93\x01\x02\x03', use_list=True) - [1, 2, 3] + >>> msgpack.unpackb(b'\x93\x01\x02\x03', use_list=False) + (1, 2, 3) -The default behavior will be changed in the future. (probably 0.4) -You should always pass the ``use_list`` keyword argument. +You should always pass the ``use_list`` keyword argument. See performance issues relating to use_list_ below. Read the docstring for other options. |