Feature request, make it possible to specify a fallback function that is called when the encoder encounters an unsupported object.
The fallback function can then handle the unsupported object using only msgspec compatible types. When decoding, a corresponding fallback function are then called to handle the decoding of the object.
Motivation
In Dask/Distributed we are discussing the replacement of msgpack. The library should be:
- fast
- secure (no arbitrary code execution when decoding)
- support basic Python types
- not convert list to tuples (can be disabled in
msgpack but with a performance penalty)
- not convert numpy scalars to python scalars
- support a fallback mechanism
Feature request, make it possible to specify a fallback function that is called when the encoder encounters an unsupported object.
The fallback function can then handle the unsupported object using only msgspec compatible types. When decoding, a corresponding fallback function are then called to handle the decoding of the object.
Motivation
In Dask/Distributed we are discussing the replacement of
msgpack. The library should be:msgpackbut with a performance penalty)