8000 Merge pull request #35 from jnothman/patch-1 · xunzhang/msgpack-python@f8d7dea · GitHub
[go: up one dir, main page]

Skip to content

Commit f8d7dea

Browse files
committed
Merge pull reques 8000 t msgpack#35 from jnothman/patch-1
Fix README re default use_list=True
2 parents 4d844df + edd2e52 commit f8d7dea

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

README.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,20 @@ msgpack provides ``dumps`` and ``loads`` as alias for compatibility with
2929
``pack`` and ``dump`` packs to file-like object.
3030
``unpack`` and ``load`` unpacks from file-like object.
3131

32+
::
33+
3234
>>> import msgpack
3335
>>> msgpack.packb([1, 2, 3])
3436
'\x93\x01\x02\x03'
3537
>>> msgpack.unpackb(_)
36-
(1, 2, 3)
37-
38+
[1, 2, 3]
3839

39-
``unpack`` unpacks msgpack's array to Python's tuple.
40-
To unpack it to list, Use ``use_list`` option.
40+
``unpack`` unpacks msgpack's array to Python's list, but can unpack to tuple::
4141

42-
>>> msgpack.unpackb(b'\x93\x01\x02\x03', use_list=True)
43-
[1, 2, 3]
42+
>>> msgpack.unpackb(b'\x93\x01\x02\x03', use_list=False)
43+
(1, 2, 3)
4444

45-
The default behavior will be changed in the future. (probably 0.4)
46-
You should always pass the ``use_list`` keyword argument.
45+
You should always pass the ``use_list`` keyword argument. See performance issues relating to use_list_ below.
4746

4847
Read the docstring for other options.
4948

0 commit comments

Comments
 (0)
0