Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Object-Oriented Python Advanced Objects Frustration

Spencer Hurrle
Spencer Hurrle
3,128 Points

frustration challenge

I'm not really sure what this error is describing... It's not clearing up where I'm doing something wrong. The error I'm getting says:

TypeError: descriptor 'init' requires a 'super' object but received a 'Liar'

Update: I figured out that I needed empty parentheses after super. After adding that, I'm getting an error saying that addition can't be done between NoneTypes and Ints. At this point it seems like the test code is off... or Ken is adding a challenge that he isn't openly stating, which is very frustrating,

frustration.py
class Liar(list):
    def __len__(value):
        wrong = super.__init__(value)
        return wrong + 2

1 Answer

Steven Parker
Steven Parker
210,871 Points

You're close, but:

  • when you call a method (like "super()"), you must put parentheses after the name
  • you should call the super's version of "__len__" instead of "__init__"
  • you won't need to pass an argument when you call the super's "__len__"
Spencer Hurrle
Spencer Hurrle
3,128 Points

That did the trick! Thanks!!