
The core of what i wanna discuss here is that i don't think mro and super (mainly because it relies on mro) are very
On 3/26/22 09:57, malmiteria wrote: pythonic. Mainly that some behaviors of the mro are too implicit, and are silencing what really should be errors. When I first started using Python I also didn't like super() and the mro. However, at some point it dawned on me that subclassing is not a trivial task -- you don't just get a new class with some neat behavior from another class -- what you get is the original class, plus some neat behavior from the new class. In other words, subclassing is a very tight coupling of code, and you had better know the classes you are inheriting from to get it right -- and that part is the programmer's responsibility, not Python's. To use your `run()` example: class A: def run(self): print('A') class B: def run(self): print('B') class Z(A, B): def run(self): # make the programmer choose raise RuntimeError("call to `run()` not allowed, choose `run_a()` or `run_b()`") def run_a(self): return A.run() def run_b(self): return B.run() -- ~Ethan~