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 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
229,744 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!!