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
Kaytlynn Ransom
Python Web Development Techdegree Student 11,409 PointsIs it ever acceptable to not create an __init__ method in a Python class?
When, if ever, would it be okay to create a Python class without an init method? Is it considered poor code design to ever have a class without the init, or are there situations when it can be a good implementation choice?
1 Answer
Steven Parker
243,656 PointsIf your class doesn't need to set up an initial state, it's quite normal to not define an __init__ method. Examples would include classes that contain only methods, or where any internal data will be added by calling methods.