20.2.0
Backward-incompatible Changes
-
attr.define()
,attr.frozen()
,attr.mutable()
, andattr.field()
remain provisional.This release fixes a bunch of bugs and ergonomics but they remain mostly unchanged.
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.define()
et al now correct detect__eq__
and__ne__
. #671 -
attr.define()
et al's hybrid behavior now also works correctly when arguments are passed. #675 -
It's possible to define custom
__setattr__
methods on slotted classes again. #681 -
In 20.1.0 we introduced the
inherited
attribute on theattr.Attribute
class to differentiate attributes that have been inherited and those that have been defined directly on the class.It has shown to be problematic to involve that attribute when comparing instances of
attr.Attribute
though, because when sub-classing, attributes from base classes are suddenly not equal to themselves in a super class.Therefore the
inherited
attribute will now be ignored when hashing and comparing instances ofattr.Attribute
. #684 -
zope.interface
is now a "soft dependency" when running the test suite; ifzope.interface
is not installed when running the test suite, the interface-related tests will be automatically skipped. #685 -
The ergonomics of creating frozen classes using
@define(frozen=True)
and sub-classing frozen classes has been improved: you don't have to seton_setattr=None
anymore. #687