20.3.0
Backward-incompatible Changes
-
attr.define()
,attr.frozen()
,attr.mutable()
, andattr.field()
remain provisional.This release does not change change anything about them and they are already used widely in production though.
If you wish to use them together with mypy, you can simply drop this plugin into your project.
Feel free to provide feedback to them in the linked issue #668.
We will release the
attrs
namespace once we have the feeling that the APIs have properly settled. #668
Changes
attr.s()
now has a field_transformer hook that is called for allAttribute
s and returns a (modified or updated) list ofAttribute
instances.attr.asdict()
has a value_serializer hook that can change the way values are converted. Both hooks are meant to help with data (de-)serialization workflows. #653kw_only=True
now works on Python 2. #700raise from
now works on frozen classes on PyPy. #703, #712attr.asdict()
andattr.astuple()
now treatfrozenset
s likeset
s with regards to the retain_collection_types argument. #704- The type stubs for
attr.s()
andattr.make_class()
are not missing the collect_by_mro argument anymore. #711