File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -29,21 +29,20 @@ msgpack provides ``dumps`` and ``loads`` as alias for compatibility with
29
29
``pack `` and ``dump `` packs to file-like object.
30
30
``unpack `` and ``load `` unpacks from file-like object.
31
31
32
+ ::
33
+
32
34
>>> import msgpack
33
35
>>> msgpack.packb([1, 2, 3])
34
36
'\x93\x01\x02\x03'
35
37
>>> msgpack.unpackb(_)
36
- (1, 2, 3)
37
-
38
+ [1, 2, 3]
38
39
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::
41
41
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)
44
44
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.
47
46
48
47
Read the docstring for other options.
49
48
You can’t perform that action at this time.
0 commit comments