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 Object-Oriented Python Advanced Objects Subclassing Built-ins

Sohail Mirza
seal-mask
.a{fill-rule:evenodd;}techdegree
Sohail Mirza
Python Web Development Techdegree Student 5,158 Points

override init

Not sure where to start from. but bascially when kenneth talks begins to talk about the init (4.30) and create the class Fillledlist he says the following So, first things first, let's go ahead and super, and then init. And we're going to ignore everything that was passed in. I don't care what they gave me. All I want is an empty list when I get to the end of this, okay? So at this point, right now, I have a brand new, empty list instance, stored inside of self.

what does he mean we are going to ignore everything and i want is a empty list this sounds very confusing..could someone please explain

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,441 Points

Kenneth means: "All I want is an empty list when I get to the end of [creating the list using the super command]" and "we are going to ignore everything passed in (count, value, and any arbitrary positional arguments and keyword arguments) for now. We'll use the count and value later on".

*args absorbs any additional positional arguments and puts them in the tuple args, and **kwargs absorbs all of the additional keyword arguments and puts them into the dict kwargs

The self attribute points to the newly created list.

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

Ali Al Dairawi
Ali Al Dairawi
1,869 Points

Chris Freeman thank you for your explanation.