cattrs v22.1.0 Release Notes

Release Date: 2022-04-03 // 3 months ago
    • cattrs now uses the CalVer versioning convention.
    • โœ… cattrs now has a detailed validation mode, which is enabled by default. Learn more here <>_. The old behavior can be restored by creating the converter with detailed_validation=False.
    • attrs and dataclass structuring is now ~25% faster.
    • ๐Ÿ›  Fix an issue structuring bare typing.List s on Pythons lower than 3.9. (#209 <>_)
    • ๐Ÿ›  Fix structuring of non-parametrized containers like list/dict/... on Pythons lower than 3.9. (#218 <>_)
    • ๐Ÿ›  Fix structuring bare typing.Tuple on Pythons lower than 3.9. (#218 <>_)
    • Fix a wrong AttributeError of an missing __parameters__ attribute. This could happen when inheriting certain generic classes โ€“ for example typing.* classes are affected. (#217 <>_)
    • ๐Ÿ›  Fix structuring of enum.Enum instances in typing.Literal types. (#231 <>_)
    • ๐Ÿ›  Fix unstructuring all tuples - unannotated, variable-length, homogenous and heterogenous - to list. (#226 <>_)
    • For forbid_extra_keys raise custom ForbiddenExtraKeyError instead of generic Exception. (#225 <>_)
    • ๐Ÿ‘€ All preconf converters now support loads and dumps directly. See an example here <>_.
    • ๐Ÿ›  Fix mappings with byte keys for the orjson, bson and tomlkit converters. (#241 <>_)

Previous changes from v1.10.0

    • โž• Add PEP 563 (string annotations) support for dataclasses. (#195 <>_)
    • ๐Ÿ›  Fix handling of dictionaries with string Enum keys for bson, orjson, and tomlkit.
    • Rename the cattr.gen.make_dict_unstructure_fn.omit_if_default parameter to _cattrs_omit_if_default, for consistency. The omit_if_default parameters to GenConverter and override are unchanged.
    • ๐Ÿ“ฆ Following the changes in attrs 21.3.0, add a cattrs package mirroring the existing cattr package. Both package names may be used as desired, and the cattr package isn't going away.