[
http://jira.msgpack.org/browse/MSGPACK-15?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10510#comment-10510 ]
EG commented on MSGPACK-15:
---------------------------
Hi Naoki,
How would msgpack pack and unpack a dictionary containing a mix of tuples and lists? Your solution does not work for something like this:
msgpack.unpackb(msgpack.packb({'field1': (0, 123), 'field2': ['a', 'b', 'c']}))
No matter what you set use_list to, one of the fields will get mangled.
> Lists turn into tuples when packing, then unpacking in Python (2.6)
> -------------------------------------------------------------------
>
> Key: MSGPACK-15
> URL:
http://jira.msgpack.org/browse/MSGPACK-15
> Project: MessagePack
> Issue Type: Bug
> Components: Specification
> Environment: Tested on Linux (RedHat) and Mac OSX using Python 2.6.1.
> Reporter: Justin Patrin
> Assignee: FURUHASHI Sadayuki
> Labels: Python
>
> Running the examples in the Python QuickStart page (and in my own tests) lists which are encoded then decoded come back as tuples.
> In [5]: import msgpack
> In [6]: serialized = msgpack.packb([1,2,3])
> In [7]: print msgpack.unpackb(serialized)
> (1, 2, 3)
> This is not correct as tuples are immutable while lists are mutable (among other differences). Both should be encoded and decoded as their own types, not as the same type.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira