Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't reset custom __setattr__ in slotted classes (#681)
* Don't reset custom __setattr__ in slotted classes Fixes #680 Signed-off-by: Hynek Schlawack <hs@ox.cx> * Simplify Signed-off-by: Hynek Schlawack <hs@ox.cx> * Be defensive about __bases__ Signed-off-by: Hynek Schlawack <hs@ox.cx> * _Classes_ always have a __dict__ * Tighten xfail * Clarify what need to be reset and when Signed-off-by: Hynek Schlawack <hs@ox.cx> * Reset __attrs_own_setattr__ along with __setattr__ Signed-off-by: Hynek Schlawack <hs@ox.cx> * Update src/attr/_make.py Co-authored-by: Paul Ganssle <paul@ganssle.io> * Differentiate between own (= attrs) and custom (= user) __setattrs__ Signed-off-by: Hynek Schlawack <hs@ox.cx> * We've always used __bases__ in our call to type() So no reason for being defensive. * Update tests/test_setattr.py Co-authored-by: Paul Ganssle <paul@ganssle.io> Co-authored-by: Paul Ganssle <paul@ganssle.io>
- Loading branch information
Showing
4 changed files
with
120 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
It's now possible to define custom ``__setattr__`` methods on slotted classes again. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters