docs: add super warning

This commit is contained in:
Hynek Schlawack 2024-02-22 05:55:45 +01:00
parent 12a3f76ff4
commit ec9ef8d174
No known key found for this signature in database
1 changed files with 7 additions and 0 deletions

View File

@ -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