While learning Python I\'m having some confusion over the syntax of the initialization of classes using inheritance. In various examples I\'ve seen something like the following
Generally passing parent
is not something that's required, only when the parent class's constructor explicitly needs such an argument. This is used in some hierarchies, such as PyQt.
And a good idiom of parent class initialization is to use super
:
class Child(Father):
def __init__(self):
super(Child, self).__init__()