mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-08 18:59:59 +00:00
kill some duplicate code from unpack/unpackb and move the logic to Unpacker.unpack_one. By doing this we no longer need to make the module-level pack/unpack parametric on the class, because they contain no logic at all
This commit is contained in:
parent
d61097511a
commit
5529dfe596
2 changed files with 52 additions and 51 deletions
|
|
@ -18,7 +18,9 @@ def test_extension_type():
|
|||
return obj
|
||||
|
||||
obj = [42, 'hello', array.array('d', [1.1, 2.2, 3.3])]
|
||||
s = msgpack.packb(obj, MyPacker)
|
||||
obj2 = msgpack.unpackb(s, MyUnpacker)
|
||||
packer = MyPacker()
|
||||
unpacker = MyUnpacker(None)
|
||||
s = packer.pack(obj)
|
||||
unpacker.feed(s)
|
||||
obj2 = unpacker.unpack_one()
|
||||
assert obj == obj2
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue