- Support encoding and decoding attrs types (#323).
- Add
repr_omit_defaults
configuration option for omitting struct default values in therepr
(#322). - Expose a struct's configuration through a
__struct_config__
attribute (#328). - Add
msgspec.structs.fields
utility function for inspecting the fields configured on a Struct (#330). - Add a
dict
configuration option for adding a__dict__
attribute to a Struct (#331). - Allow non-struct mixins to be used with struct types (#332).
- Fix a bug when defining both
lt
andgt
constraints on an integer type (#335). - Fix a bug supporting fields defined with
msgspec.field()
with no arguments (#343). - Allow arbitrary input types to
msgspec.from_builtins
(#346). - Support decoding into subclasses of
int
&bytes
inmsgspec.from_builtins
(#346). - Add
msgspec.UNSET
andmsgspec.UnsetType
for tracking unset fields. See the docs for more information (#350). - BREAKING: In the unlikely event you were using the previous
msgspec.UNSET
singleton to explicitly indicate no default value on struct types, you should now make use ofmsgspec.NODEFAULT
instead (#350). - Improve struct type annotations now that
mypy
supportstyping.dataclass_transform
(#352). - Support
typing.Final
annotations for indicating that an object field should be treated as immutable (#354). - Add a
name
keyword option tomsgspec.field
for renaming a single field (#356). - BREAKING: The rules around class inheritance and a struct's
rename
option have changed. See #356 for more information.