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

Michael Braun
Michael Braun
6,753 Points

Where is the parent class for Hand(list)

Maybe I'm missing something but I don't understand why he passes in (list) as the parent class for Hand. What parent class is Kenneth referring to? The only other classes in this game that we created are Die and D6.

2 Answers

andren
andren
28,558 Points

list is one of the classes that are built into Python itself. It is the same class that you end up instantiating every time you use a list value in Python. And whenever you have converted something like a string to a list using list() you have actually been calling the constructor method of the list class.

In Python pretty much all of the built-in datatypes like strings, ints and the like are actually classes built into the language. Which means that you can inherit from them, and therefore create modified versions of them. Which is what Kenneth is doing in the video you are referencing.

Michael Braun
Michael Braun
6,753 Points

Gotcha! Thanks so much for explaining that to me! You're awesome!