Python Object-Oriented Python Dice Roller Giving a Hand

Marcus Schumacher
Marcus Schumacher
14,084 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 59,730 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!!!

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