"UIKit Dynamics" was retired on May 31, 2020.

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

mourad marzouk
mourad marzouk
5,560 Points

why is there a super there

In this video he has a super in the very first parent class...

class Hand(list): def init(self, size=0, *args, **kwargs): super().init() #this one, why is this here?

Why is that there?

2 Answers

This is because Hand class is a subclass from List.

Hence it is correct to have the super().init() to initialize the list parent class.

mourad marzouk
mourad marzouk
5,560 Points

Ah ok I see. so its using the built in list() method as a parent class. so follow up why is he doing that?

lets simply put it this sub class is trying to act like a list hence he actually inherits the list class.

I hope this clarify your doubt?