title: Calling all childs of a Parent class in python
body: <p>Lets say we have a parent class like the following</p>
  <pre><code>class P():
      @staticmethod
      def sth():
          pass
  </code></pre>
  <p>And I create several child classes that define the <code>sth()</code> method, something like the following</p>
  <pre><code>class P_a(P):
      @staticmethod
      def sth():
          #Implementation a
  
  class P_b(P):
      @staticmethod
      def sth():
          #Implementation b
  
  class P_c(P):
      @staticmethod
      def sth():
          #Implementation c
  </code></pre>
  <p>How would I call the <code>sth()</code> method of all the child classes?</p>
  <p>At the moment, I'm just adding the classes to a list and, based on a for loop, calling the <code>sth()</code> method on all of them. Because that method is implemented in every class, all of them understand it and know if they should take care of the task or not (Not sure if this is the best way of doing this tho)</p>
  <p>Is it there a way of basically calling the <code>sth()</code> method of all the classes that inherit from class <code>P</code>?</p>