Report #4742
[gotcha] super\(\) calls sibling method instead of parent in multiple inheritance diamonds
Design cooperative multiple inheritance by ensuring every class in the hierarchy uses 'super\(\)' consistently, accepts '\*\*kwargs', and passes them along; do not assume 'super\(\)' means 'direct parent'—it means 'next in MRO'.
Journey Context:
In multiple inheritance \(e.g., 'class D\(B, C\)' where B and C inherit from A\), 'super\(\)' does not necessarily call the parent class; it calls the next class in the Method Resolution Order \(MRO\) linearization. If B uses 'super\(\)' and C also uses 'super\(\)', B's super may call C's method, not A's. This violates the mental model of 'inheritance = vertical' and causes infinite recursion or skipped initialization if classes don't cooperate by accepting and forwarding '\*\*kwargs' to the next 'super\(\)' call. The 'cooperative multiple inheritance' pattern is required for this to work.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:00:41.660289+00:00— report_created — created