You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Potentially breaking: The converters raise StructureHandlerNotFoundError more eagerly (on hook creation, instead of on hook use). This helps surfacing problems with missing hooks sooner. See Migrations for steps to restore legacy behavior.
(#577)
Add a Migrations page, with instructions on migrating changed behavior for each version.
(#577)
typing.Self is now supported in attrs classes, dataclasses, TypedDicts and the dict NamedTuple factories. See typing.Self for details.
(#299#627)
PEP 695 type aliases can now be used with BaseConverter.register_structure_hook and BaseConverter.register_unstructure_hook. Previously, they required the use of BaseConverter.register_structure_hook_func (which is still supported).
(#647)
Expose cattrs.cols.mapping_unstructure_factory through cattrs.cols.
Some defaultdicts are now supported by default, and cattrs.cols.is_defaultdict and cattrs.cols.defaultdict_structure_factory are exposed through cattrs.cols.
(#519#588)
Generic PEP 695 type aliases are now supported.
(#611#618)
Converter.copy and BaseConverter.copy are correctly annotated as returning Self.
(#644)
Many preconf converters (bson, stdlib JSON, cbor2, msgpack, msgspec, orjson, ujson) skip unstructuring int and str enums, leaving them to the underlying libraries to handle with greater efficiency.
(#598)
The msgspec JSON preconf converter now handles dataclasses with private attributes more efficiently.
(#624)
Literals containing enums are now unstructured properly, and their unstructuring is greatly optimized in the bson, stdlib JSON, cbor2, msgpack, msgspec, orjson and ujson preconf converters.
(#598)
Preconf converters now handle dictionaries with literal keys properly.
(#599)
Structuring TypedDicts from invalid inputs now properly raises a ClassValidationError.
(#615#616)
cattrs.strategies.include_subclasses now properly works with generic parent classes.
(#649)
Replace cattrs.gen.MappingStructureFn with cattrs.SimpleStructureHook.