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

Why do we need to put sneaky = True in the Thief class and then again for self.sneaky = True under super()?

Maybe I missed it in the video but Im not sure why we need to put sneaky = True in the Thief class (right under class Thief(Character):) and then again for self.sneaky = True under super() in the __init__ method

do we need to put the first sneaky under the class?

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,423 Points

The class attribute is not needed since every instance will initialize the sneaky attribute during the __init__ method.

I suspect the class attribute was left over from before the __init__ was fully defined.