Python · Classes and Object Design · Intermediate · 30 min read
Classes and Objects Done Right in Python: Attributes, Properties, Class Methods and Design
Design Python classes that stay simple and safe. Learn instance versus class attributes, how attribute lookup works, properties instead of getters and setters, classmethod and staticmethod, alternative constructors, encapsulation conventions, __slots__ and when not to use a class at all.
Create an account to start
Create a free account to see what this lesson covers
- Every free lesson in every section, in full
- Track your progress and pick up where you left off
- Free practice questions and an incident simulation
- Takes under a minute: name, email and a password
No card needed. Full access to Python is a paid upgrade you can choose later.