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 Double

Did it just like the video and I am getting it wrong. Any advice?

Can someone help me please.

doubler.py
class Double(int):
    def __new__(self, *args, **kwargs)
        self = int.__new__(*args, **kwargs)
        return self

1 Answer

Gabbie Metheny
Gabbie Metheny
33,778 Points

I just rewatched the video, and Kenneth actually doesn't pass self into def __new__: just *args and **kwargs. The self on the next line is just acting as a variable, Kenneth said you actually could name it anything, so it doesn't need to be passed into def __new__. Try removing self on your second line, and it should work!

Gabbie Metheny
Gabbie Metheny
33,778 Points

Oh, just noticed one more thing! You're missing the colon at the end of your def __new__ as well.

Thanks, Gabbie and always your second comment helped me a lot :)