I'm hoping to inherit from two different classes that have different inputs into their __init__
methods. How do I properly inherit from them both?
Below is a simple example of what I'm trying to accomplish:
class a:
def __init__(self):
print("Hello")
class b(a):
def __init__(self):
super().__init__()
print("World")
class c:
def __init__(self, text):
print(text)
class d(a, c):
def __init__(self):
super().__init__('Kronos') # <-- This breaks (and understandably so)
While similar to many other questions of multiple inheritance (i.e. How does Python's super() work with multiple inheritance?), I'm looking for how to inherit from multiple classes with different inputs to their __init__
.