FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Allow default handler to take a position parameter by PeterC-DLS · Pull Request #718 · msgpack/msgpack-python · GitHub

Allow default handler to take a position parameter - #718

Open
PeterC-DLS wants to merge 3 commits into
msgpack:mainfrom
DiamondLightSource:add-default-handler-posn
Open

Allow default handler to take a position parameter#718
PeterC-DLS wants to merge 3 commits into
msgpack:mainfrom
DiamondLightSource:add-default-handler-posn

Conversation

Copy link
Copy Markdown

This enables padding to be computed when packing a custom type and enables zero-copy unpacking by aligning primitives correctly. The code in test_default demonstrates correct padding for arrays.

This is motivated by passing NumPy's ndarrays with their raw data in bin format to a web frontend where TypedArrays must be correctly aligned otherwise a copy must be taken by slicing the underlying ArrayBuffer (in the @msgpack/msgpack package). Note, the Javascript library gives access to the encoder context for extension types but this is not available for this Python library.

This enables padding to be computed when packing a custom type and
enables zero-copy unpacking by aligning primitives correctly

methane commented Jul 21, 2026

Copy link
Copy Markdown
Member

memo: msgpack/msgpack-javascript#248

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL