Python Object-Oriented Python Dice Roller Giving a Hand

Marcus Schumacher
Marcus Schumacher
13,153 Points

What is the point of passing *args and **kwargs in the __init__ of Hand and YatzyHand classes?

I don't see us using them anywhere, so why are we including them as parameters?

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 58,991 Points

In this case, there is zero need for the *args and **kwargs to be included.

In general they’re included to pass arguments through child class and on to the parents class. Since Hand does nothing with them, there is no need for YatzyHand to pass them along. I might argue that having them there is might be harmful since extra arguments would we silently swallowed up.

Post back if you need more help. Good luck!!!

Alex Anarcho
Alex Anarcho
5,167 Points

Thank you for the explanation. It had me confused as well