jcrist · GitHub

@jcrist

This adds a new `msgspec.to_builtins` function, for transforming objects
composed of all the types `msgspec` supports to objects composed only of
types standard python serializers support (`list`, `tuple`, `int`,
`str`, ...).
While this method *may* be useful directly to users, the primary
intended use is for wrapping it with additional serialization APIs
within `msgspec` itself (for example, a new `msgspec.yaml` module).
While JSON may require high-performance and a builtin encoder,
config-files like YAML, TOML, ... usually aren't performance sensitive,
so the extra copies here shouldn't matter.
Once this is in, we'll follow up with a `msgspec.from_builtins` for
handling the "decoding" side of things.

Read the original on github.com ↗