attrs v16.1.0 Release Notes
Release Date: 2016-08-30 // over 7 years ago-
Backward-incompatible Changes:
- All instances where function arguments were called
cl
have been changed to the more Pythoniccls
. Since it was always the first argument, it's doubtful anyone ever called those function with in the keyword form. If so, sorry for any breakage but there's no practical deprecation path to solve this ugly wart.
๐ Deprecations: ^
- ๐ Accessing
Attribute
instances on class objects is now deprecated and will stop working in 2017. If you need introspection please use the__attrs_attrs__
attribute or theattr.fields()
function that carry them too. In the future, the attributes that are defined on the class body and are usually overwritten in your__init__
method are simply removed after@attr.s
has been applied.
This will remove the confusing error message if you write your own
__init__
and forget to initialize some attribute. Instead you will get a straightforwardAttributeError
. In other words: decorated classes will work more like plain Python classes which was alwaysattrs
's goal.- ๐ The serious business aliases
attr.attributes
andattr.attr
have been deprecated in favor ofattr.attrs
andattr.attrib
which are much more consistent and frankly obvious in hindsight. They will be purged from documentation immediately but there are no plans to actually remove them.
๐ Changes: ^
attr.asdict()
\ 'sdict_factory
arguments is now propagated on recursion.#45 <https://github.com/python-attrs/attrs/issues/45>
_attr.asdict()
,attr.has()
andattr.fields()
are significantly faster.#48 <https://github.com/python-attrs/attrs/issues/48>
_#51 <https://github.com/python-attrs/attrs/issues/51>
_- โ Add
attr.attrs
andattr.attrib
as a more consistent aliases forattr.s
andattr.ib
. - Add frozen option to
attr.s
that will make instances best-effort immutable.#60 <https://github.com/python-attrs/attrs/issues/60>
_ attr.asdict()
now takesretain_collection_types
as an argument. IfTrue
, it does not convert attributes of typetuple
orset
tolist
.#69 <https://github.com/python-attrs/attrs/issues/69>
_
- All instances where function arguments were called