TGViewer
Python Learning Python Learning @python_bds · 5.74K subscribers
Post #1233 780
super() is linear. Your brain is not.

You have class A, B, C. Multiple inheritance. You call super().method() inside B. Which method runs? Not necessarily the parent of B. It depends on the Method Resolution Order of the instance.

Most developers learn MRO once, forget it, then get confused when super() jumps sideways instead of up.

Take this:
class A:
def f(self): print("A")

class B(A):
def f(self): print("B"); super().f()

class C(A):
def f(self): print("C"); super().f()

class D(B, C):
def f(self): print("D"); super().f()

D().f() prints D, B, C, A. Not B then A. Because super() in B calls next in MRO which is C, not A.

This is not a bug. It's cooperative multiple inheritance. It allows mixins and dependency injection. But if you don't understand it, you will spend hours wondering why super().f() skipped a generation.

✔️ The rule: super() follows the MRO, not the parent hierarchy. Print ClassName.__mro__ before you debug.
  • ❤ 2
More from @python_bds
  1. Oct 8, 2026🐛 This Python Bug Looks Random, But It Isn't Look at this: functions = [] for i in range(…
  2. Oct 6, 2026🐍 Python Performance Optimization Python Performance Optimization: Make Your Code Faster…
  3. Oct 4, 2026Python Set Methods ✍️
  4. Oct 3, 2026Post #1310
  5. Oct 1, 2026🐍 Python Beginner Notes
  6. Sep 30, 2026🧠 return vs print() in Python These are not interchangeable. def add(a, b): print(a + b)…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →