Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Object-Oriented Python Dice Roller Giving a Hand

Jay Reyes
seal-mask
.a{fill-rule:evenodd;}techdegree
Jay Reyes
Python Web Development Techdegree Student 15,937 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)