If I've got three classes like this:
def __init__(self, base_arg, base_arg2=None):
def __init__(self, mixin_arg):
class ChildClass(BaseClass, MixinClass):
def __init__(self, base_arg, mixin_arg, base_arg2=None):
Basically, in Python, you can't support this type of inheritance safely. Luckily you almost never need to, since most methods don't care what something is, only that it supports a particular interface. Your best bet is to use composition or aggregation: have your class inherit from one of the parent classes, and contain a reference to an instance of the second class. As long as your class supports the interface of the second class (and forwards messages to the contained instance) this will probably work out fine.
In the above example (where both classes inherit from
object) you can (probably) safely just inherit from both classes and call both constructors using
BaseClass.__init__. But note that's not safe to do if the parent classes call
super in their constructors. A good rule of thumb is to use
super if the parent classes use
__init__ if the parent classes use
__init__, and hope you're never trapped having to inherit from two classes which chose different methods for initialization.