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: 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:28bc4bf4-cb0b-b306-39d9-9d866808389c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8F18:19F60D:25A5253:320E5C2:6A521067 |
| html-safe-nonce | d6cf2f7c4272e37596cf14af52d0f42bc0ed4fa5bd5183d8fad590fce79455c9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjE4OjE5RjYwRDoyNUE1MjUzOjMyMEU1QzI6NkE1MjEwNjciLCJ2aXNpdG9yX2lkIjoiMzI2NzQ3MDc4NjgxOTEzMzU0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 59e5c1a789662d36bc43b22f0d2be1f8c21b468d762080adbee8280cdd1524a9 |
| 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 | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width