Skip to content

Commit 563553b

Browse files
committed
Semantic linebreaks
1 parent 6e3786c commit 563553b

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

changelog.d/1457.breaking.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
Class-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
5-
setting is ignored, and it is still made keyword-only.
3+
Previously, a class that sets `kw_only=True` makes all attributes keyword-only, including those from base classes.
4+
If an attribute sets `kw_only=False`, that setting is ignored, and it is still made keyword-only.
65

7-
Now, only the attributes defined in that class that doesn't explicitly set
8-
`kw_only=False` are made keyword-only.
6+
Now, only the attributes defined in that class that doesn't explicitly set `kw_only=False` are made keyword-only.
97

108
This shouldn't be a problem for most users, unless you have a pattern like this:
119

@@ -20,9 +18,5 @@ class Subclass(Base):
2018
c: int
2119
```
2220

23-
Here, we have a `kw_only=True` attrs class (`Base`) with an attribute that sets
24-
`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
26-
would 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.
21+
Here, we have a `kw_only=True` *attrs* class (`Base`) with an attribute that sets `kw_only=False` and has a default (`Base.b`), and then create a subclass (`Subclass`) with required arguments (`Subclass.c`).
22+
Previously this would work, since it would make `Base.b` keyword-only, but now this fails since `Base.b` is positional, and we have a required positional argument (`Subclass.c`) following another argument with defaults.

0 commit comments

Comments
 (0)