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 <https://cattrs.readthedocs.io/en/latest/validation.html>
_. The old behavior can be restored by creating the converter withdetailed_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 <https://github.com/python-attrs/cattrs/issues/209>
_) - ๐ Fix structuring of non-parametrized containers like
list/dict/...
on Pythons lower than 3.9. (#218 <https://github.com/python-attrs/cattrs/issues/218>
_) - ๐ Fix structuring bare
typing.Tuple
on Pythons lower than 3.9. (#218 <https://github.com/python-attrs/cattrs/issues/218>
_) - Fix a wrong
AttributeError
of an missing__parameters__
attribute. This could happen when inheriting certain generic classes โ for exampletyping.*
classes are affected. (#217 <https://github.com/python-attrs/cattrs/issues/217>
_) - ๐ Fix structuring of
enum.Enum
instances intyping.Literal
types. (#231 <https://github.com/python-attrs/cattrs/pull/231>
_) - ๐ Fix unstructuring all tuples - unannotated, variable-length, homogenous and heterogenous - to
list
. (#226 <https://github.com/python-attrs/cattrs/issues/226>
_) - For
forbid_extra_keys
raise customForbiddenExtraKeyError
instead of genericException
. (#225 <https://github.com/python-attrs/cattrs/pull/225>
_) - ๐ All preconf converters now support
loads
anddumps
directly. See an examplehere <https://cattrs.readthedocs.io/en/latest/preconf.html>
_. - ๐ Fix mappings with byte keys for the orjson, bson and tomlkit converters.
(
#241 <https://github.com/python-attrs/cattrs/issues/241>
_)
Previous changes from v1.10.0
-
- โ Add PEP 563 (string annotations) support for dataclasses.
(
#195 <https://github.com/python-attrs/cattrs/issues/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. Theomit_if_default
parameters toGenConverter
andoverride
are unchanged. - ๐ฆ Following the changes in
attrs
21.3.0, add acattrs
package mirroring the existingcattr
package. Both package names may be used as desired, and thecattr
package isn't going away.
- โ Add PEP 563 (string annotations) support for dataclasses.
(