How do I add keyword arguments to a derived class's constructor in Python?
I want to add keyword arguments to a derived class, but can't figure out how to go about it. Trying the obvious class ClassA(some.package.Class): def __init__(self, *args, **kwargs): super(ClassA, self).__init__(*args, **kwargs) class ClassB(ClassA): def __init__(self, *args, a='A', b='B', c='C', **kwargs): super(ClassB, self).__init__(*args, **kwargs) self.a=a self.b=b self.c=c fails because I can't list parameters like that for ClassB 's __init__ . And class ClassB(ClassA): def __init__(self, *args, **kwargs): super(ClassA, self).__init__(*args, **kwargs) self.a=a self.b=b self.c=c of course