packb serializes a mapping with a tuple key without error, but the produced bytes cannot be deserialized: unpackb decodes the tuple key as a list, then fails to use it as a dict key.
import msgpack
b = msgpack.packb({(1, 2): 0}) # succeeds (5 bytes)
msgpack.unpackb(b, strict_map_key=False) # TypeError: unhashable type: 'list'
Environment: msgpack-python 1.2.1, Python 3.13.12.
Expected: either packb should raise on a key that cannot survive a round trip, or the limitation should be documented. Currently it is silent at pack time and only fails on unpack. Found by round-trip testing (106/3000 random structured inputs, all reducing to a tuple-keyed dict).
packbserializes a mapping with a tuple key without error, but the produced bytes cannot be deserialized:unpackbdecodes the tuple key as alist, then fails to use it as a dict key.Environment: msgpack-python 1.2.1, Python 3.13.12.
Expected: either
packbshould raise on a key that cannot survive a round trip, or the limitation should be documented. Currently it is silent at pack time and only fails on unpack. Found by round-trip testing (106/3000 random structured inputs, all reducing to a tuple-keyed dict).