cattrs v1.8.0 Release Notes
Release Date: 2021-08-13 // over 2 years ago-
- ๐ Fix
GenConverter
mapping structuring for unannotated dicts on Python 3.8. (#151 <https://github.com/python-attrs/cattrs/issues/151>
_) - The source code for generated un/structuring functions is stored in the
linecache
cache, which enables more informative stack traces when un/structuring errors happen using theGenConverter
. This behavior can optionally be disabled to save memory. - ๐ Support using the attr converter callback during structure.
By default, this is a method of last resort, but it can be elevated to the default by setting
prefer_attrib_converters=True
onConverter
orGenConverter
. (#138 <https://github.com/python-attrs/cattrs/issues/138>
_) - ๐ Fix structuring recursive classes.
(
#159 <https://github.com/python-attrs/cattrs/issues/159>
_) - ๐ Converters now support un/structuring hook factories. This is the most powerful and complex venue for customizing un/structuring. This had previously been an internal feature.
- ๐ The
Common Usage Examples <https://cattrs.readthedocs.io/en/latest/usage.html#using-factory-hooks>
_ documentation page now has a section on advanced hook factory usage. - ๐
cattr.override
now supports theomit
parameter, which makescattrs
skip the atribute entirely when unstructuring. - ๐ฆ The
cattr.preconf.bson
module is now tested against thebson
module bundled with thepymongo
package, because that package is much more popular than the standalone PyPIbson
package.
- ๐ Fix