Python Object-Oriented Python Dice Roller Giving a Hand

Jay Reyes
Jay Reyes
Python Web Development Techdegree Student 15,935 Points

Why don’t we need to pass those keyword arguments of YatzyHand in it's own __init__?

I've noticed that we typically pass arguments from a subclass's init to it's parent. However the below seems different:

class YatzyHand(Hand):
  def __init__(self, *args, **kwargs):
    super().__init__(size=5, die_class=D6, *args, **kwargs)

I thought we would write it out like the below:

class YatzyHand(Hand):
  def __init__(self, size=5, die_class=D6, *args, **kwargs):
    super().__init__(size=size, die_class=die_class, *args, **kwargs)

or this?

class YatzyHand(Hand):
  def __init__(self, size=5, die_class=D6, *args, **kwargs):
    super().__init__(size=self.size, die_class=self.die_class, *args, **kwargs)