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 the GenConverter. 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 on Converter or GenConverter. (#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 the omit parameter, which makes cattrs skip the atribute entirely when unstructuring.
    • ๐Ÿ“ฆ The cattr.preconf.bson module is now tested against the bson module bundled with the pymongo package, because that package is much more popular than the standalone PyPI bson package.