Skip to content

Commit

Permalink
docs: add super warning
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Feb 22, 2024
1 parent 12a3f76 commit ec9ef8d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,13 @@ C(x=42)

If you need more control, use the custom init approach described next.

:::{warning}
You never need to use `super()` with *attrs* classes that inherit from other *attrs* classes.
Each *attrs* class implements an `__init__` based on its own fields and those of all its base classes.

You only need this escape hatch when subclassing non-*attrs* classes.
:::


### Custom Init

Expand Down

0 comments on commit ec9ef8d

Please sign in to comment.