jcrist / msgspec

A fast serialization and validation library, with builtin support for JSON, MessagePack, YAML, and TOML
https://jcristharif.com/msgspec/
BSD 3-Clause "New" or "Revised" License
2.43k stars 75 forks source link

Simply override encode/decode behavior around a builtin #766

Open clintval opened 2 weeks ago

clintval commented 2 weeks ago

Description

I'd like to encode None as the string "." and decode it back to None.

All other behavior of this library is extremely desirable and functional, but I cannot figure how to implement custom enc/dec callbacks for already defined builtin-types. Any advice or intentions to support this feature?