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 trialOmkar Palekar
3,503 Points`__new__` doesn't expect an instance argument?......can anyone explain me this error
this is my code:
class Double(int): def init(self): int.init(self)
def __new__(*args, **kwargs):
self = int.__new__(*args, **kwargs)
return self
`__new__` doesn't expect an instance argument?......can anyone explain me this error
class Double(int):
def __init__(self):
int.__init__(self)
def __new__(*args, **kwargs):
self = int.__new__(*args, **kwargs)
return self
1 Answer
Saugat Mukherjee
3,272 PointsThis should be ok
class Double(int):
def __new__(*args,**kwargs):
return int.__new__(*args,**kwargs)