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 trialMichael Gallego
1,568 PointsDid it just like the video and I am getting it wrong. Any advice?
Can someone help me please.
class Double(int):
def __new__(self, *args, **kwargs)
self = int.__new__(*args, **kwargs)
return self
1 Answer
Gabbie Metheny
33,778 PointsI 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
33,778 PointsGabbie Metheny
33,778 PointsOh, just noticed one more thing! You're missing the colon at the end of your
def __new__
as well.Michael Gallego
1,568 PointsMichael Gallego
1,568 PointsThanks, Gabbie and always your second comment helped me a lot :)
Gabbie Metheny
33,778 PointsGabbie Metheny
33,778 PointsYou bet!