File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11Class-level ` kw_only=True ` behavior is now consistent with ` dataclasses ` .
22
3- Previously, a class that sets ` kw_only=True ` makes all attributes keyword-only,
4- including those from base classes. If an attribute sets ` kw_only=False ` , that
3+ Previously, a class that sets ` kw_only=True ` makes all attributes keyword-only,
4+ including those from base classes. If an attribute sets ` kw_only=False ` , that
55setting is ignored, and it is still made keyword-only.
66
77Now, only the attributes defined in that class that doesn't explicitly set
@@ -22,7 +22,7 @@ class Subclass(Base):
2222
2323Here, we have a ` kw_only=True ` attrs class (` Base ` ) with an attribute that sets
2424` kw_only=False ` and has a default (` Base.b ` ), and then create a subclass (` Subclass ` )
25- with required arguments (` Subclass.c ` ). Previously this would work, since it
25+ with required arguments (` Subclass.c ` ). Previously this would work, since it
2626would make ` Base.b ` keyword-only, but now this fails since ` Base.b ` is positional, and
27- we have a required positional argument (` Subclass.c ` ) following another argument with
28- defaults.
27+ we have a required positional argument (` Subclass.c ` ) following another argument with
28+ defaults.
You can’t perform that action at this time.
0 commit comments