title: How do derived class constructors work in python?
body: <p>I have the following base class:</p>
  
  <pre><code>class NeuralNetworkBase:
      def __init__(self, numberOfInputs, numberOfHiddenNeurons, numberOfOutputs):
          self.inputLayer = numpy.zeros(shape = (numberOfInputs))
          self.hiddenLayer = numpy.zeros(shape = (numberOfHiddenNeurons))
          self.outputLayer = numpy.zeros(shape = (numberOfOutputs))
  
          self.hiddenLayerWeights = numpy.zeros(shape = (numberOfInputs, numberOfHiddenNeurons))
          self.outputLayerWeights = numpy.zeros(shape = (numberOfHiddenNeurons, numberOfOutputs))
  </code></pre>
  
  <p>now, I have a derived class with the following code:</p>
  
  <pre><code>class NeuralNetworkBackPropagation(NeuralNetworkBase):
      def __init__(self, numberOfInputs, numberOfHiddenNeurons, numberOfOutputs):
          self.outputLayerDeltas = numpy.zeros(shape = (numberOfOutputs))
          self.hiddenLayerDeltas = numpy.zeros(shape = (numberOfHiddenNeurons))
  </code></pre>
  
  <p>But when I instantiate NeuralNetworkBackPropagation I'd like that both constructors get called.This is, I don't want to override the base class' constructor. Does python call by default the base class constructor's when running the derived class' one? Do I have to implicitly do it inside the derived class constructor?</p>