Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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)