title: How to reference a children method in a parent method in Python?
body: <p>I want to define a parent class called &quot;Dice&quot; and a few children classes, that represent different kinds of dice (for example D6, D20, and so on).
  Every Die has some common structure, for example you can roll every Die, but the rules that decide the output are different.</p>
  <p>I want to define a method that rolls the die in the parent class Dice, so that I won't have to define roll for every children class, but it also needs to reference to the kind of dice defined in the children class.</p>
  <p>This is the code snippet:</p>
  <pre><code>import numpy 
  
  class Dice:
      def __init__(self, name):
          self.name = name
      def roll(self):
         return self.result()
  
  class D6(Dice):
      def __init__(self, name):
          super().__init__(name)
      def result(self):
          return numpy.random.randint(1, 6)
  </code></pre>
  <p>I would like to know if referencing to the children method &quot;result&quot; in the parent method &quot;roll&quot; is considered bad design or if I am good to go.
  I know that one way to solve my doubt would be giving the number of faces as an input when instancing a new die, but in the future I would like to define more complex dice that follow more complex rules.</p>