GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fallback: preserve list_hook results with use_list=False by AryanRG · Pull Request #750 · msgpack/msgpack-python

Conversation

@AryanRG

@AryanRG AryanRG commented Oct 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

The pure-Python Unpacker loses a list_hook callback's mapping values when use_list=False. It calls the hook with a list, then converts the hook's return value to a tuple. A hook returning {"items": items} therefore produces ('items',) instead of preserving the mapping.

Convert the decoded array to a tuple before calling the hook, then return the callback result unchanged. This supplies tuple input for use_list=False and preserves the callback's result, matching the native implementation. use_list=True continues to supply list input. The regression covers unpackb, feed-based and file-backed Unpacker, and decoding a following streamed object.

Validation on macOS arm64:

  • Red before / green after: the new regression fails against the pristine fallback with ('items',) instead of {'items': (1, 2)}, then passes with the fix on both backends.
  • CPython 3.13 native suite: 146 passed, 1 skipped.
  • CPython 3.13 fallback suite: 143 passed, 4 skipped.
  • An independent 125-case probe suite passed on native and fallback CPython 3.13, and fallback CPython 3.10. The fallback full suite on CPython 3.10 also had 143 passed, 4 skipped. Probes included nested hooks, return-value identity, non-iterable and lazy results, partial feeds, exceptions, and stream alignment.
  • Ruff lint, format check, and git diff --check passed.

Local coverage is limited to macOS and CPython 3.10/3.13 (native coverage on 3.13 only). PyPy, other platforms, and hosted CI have not been verified. Skipped tests are excluded from the passed counts.

AI assistance was used to prepare the implementation and regression tests.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@AryanRG
Fix fallback list_hook result with use_list=False
7f9e070

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@AryanRG
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.