Title: `packb` accepts a dict with a tuple key but the result cannot be `unpackb`'d (round-trip asymmetry) · Issue #703 · msgpack/msgpack-python · GitHub
Open Graph Title: `packb` accepts a dict with a tuple key but the result cannot be `unpackb`'d (round-trip asymmetry) · Issue #703 · msgpack/msgpack-python
X Title: `packb` accepts a dict with a tuple key but the result cannot be `unpackb`'d (round-trip asymmetry) · Issue #703 · msgpack/msgpack-python
Description: 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}) # succee...
Open Graph Description: 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...
X Description: 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...
Opengraph URL: https://github.com/msgpack/msgpack-python/issues/703
X: @github
Domain: redirect.github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`packb` accepts a dict with a tuple key but the result cannot be `unpackb`'d (round-trip asymmetry)","articleBody":"`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.\n\n```python\nimport msgpack\nb = msgpack.packb({(1, 2): 0}) # succeeds (5 bytes)\nmsgpack.unpackb(b, strict_map_key=False) # TypeError: unhashable type: 'list'\n```\nEnvironment: msgpack-python 1.2.1, Python 3.13.12.\n\nExpected: 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).","author":{"url":"https://github.com/BoxiYu","@type":"Person","name":"BoxiYu"},"datePublished":"2026-06-21T17:24:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/703/msgpack-python/issues/703"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:63ce24d0-9a85-08ee-b8e3-6ceb66026dad |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C0A4:FCD5E:17E0692:1F4D5FC:6A51C9B8 |
| html-safe-nonce | fa9b1e299405866c07fdd97714c80b162e52ef656d2066be39970987e1b77a74 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMEE0OkZDRDVFOjE3RTA2OTI6MUY0RDVGQzo2QTUxQzlCOCIsInZpc2l0b3JfaWQiOiI3Mjc0NTIyMjE4NTMyNTU1MTkyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e63ee2813c92df3b967373d40d13e0a90d258a27334899ad4ec5abe08055af4d |
| hovercard-subject-tag | issue:4711331178 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/msgpack/msgpack-python/703/issue_layout |
| twitter:image | https://opengraph.githubassets.com/31c99304cf97ea41c64fc3c0fbf8513627ebcd4fa07c6b2bbd8a29950d1b2608/msgpack/msgpack-python/issues/703 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/31c99304cf97ea41c64fc3c0fbf8513627ebcd4fa07c6b2bbd8a29950d1b2608/msgpack/msgpack-python/issues/703 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | BoxiYu |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/msgpack/msgpack-python git https://github.com/msgpack/msgpack-python.git |
| octolytics-dimension-user_id | 198264 |
| octolytics-dimension-user_login | msgpack |
| octolytics-dimension-repository_id | 2242705 |
| octolytics-dimension-repository_nwo | msgpack/msgpack-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 2242705 |
| octolytics-dimension-repository_network_root_nwo | msgpack/msgpack-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width