Skip to content

Add a 'Bypass' type that just concatenates its contents to output#661

Open
marcoffee wants to merge 1 commit intomsgpack:mainfrom
marcoffee:feature/bypass
Open

Add a 'Bypass' type that just concatenates its contents to output#661
marcoffee wants to merge 1 commit intomsgpack:mainfrom
marcoffee:feature/bypass

Conversation

@marcoffee
Copy link

@marcoffee marcoffee commented Feb 13, 2026

This is a very useful feature for when you have a class that know how to convert its structure to msgpack (specially from compiled modules) and you don't want to have its contents converted to the binary object by returning the converted msgpack from default.

As an example, orjson has a similar feature, which they call Fragment.

Some use cases include, but are not limited to:

  • bypassing valid msgpack data from compiled classes (specially deep classes, with many subclasses, dicts, lists)
  • caching msgpack output when you need to serialize a class multiple times on the same or different calls
  • appending an already serialized payload to a new payload (such as including it on a list or as a value on a dict)

PS: Sorry for closing and reopening it, I had some failed linter tests and wanted to fix them, but ended up pushing a version without any changes, which triggered GitHub's auto close feature.

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.

1 participant