From ec9ef8d174e27491a752e4b1286187f6f7842754 Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Thu, 22 Feb 2024 05:55:45 +0100 Subject: [PATCH] docs: add super warning --- docs/init.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/init.md b/docs/init.md index b7d674f0..c43cede9 100644 --- a/docs/init.md +++ b/docs/init.md @@ -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