Object-Oriented Programming (OOP)
Learning Path ⋅ Skills: Python, OOP, Classes, Data Classes, Getters, Setters, Property, super(), Magic Methods, Operator Overloading, SOLID, Inheritance, Composition, Mixin Classes, Factory Pattern
You’ll start with the fundamentals of classes and OOP concepts, then build on that with data classes, constructors, and super(). From there, you’ll explore magic methods, managed attributes, inheritance, composition, and design patterns like Factory Method and SOLID.
Object-Oriented Programming (OOP)
Learning Path ⋅ 18 Resources
Getting Started With OOP
Learn what object-oriented programming is and how Python implements it. You’ll get familiar with classes, objects, attributes, and methods.
Course
Intro to Object-Oriented Programming (OOP) in Python
Learn Python OOP fundamentals fast: master classes, objects, and constructors with hands-on lessons in this beginner-friendly video course.
Interactive Quiz
Object-Oriented Programming (OOP) in Python
Course
Class Concepts: Object-Oriented Programming in Python
Python uses object-oriented programming to group data and associated operations together into classes. In this video course, you'll learn how to write object-oriented code with classes, attributes, and methods.
Interactive Quiz
Python Classes - The Power of Object-Oriented Programming
Building and Customizing Classes
Now that you know the basics, learn how to customize your classes. You’ll work with data classes, different types of constructors, and the super() function for calling parent class methods.
Course
Using Data Classes in Python
Data classes are one of the new features introduced in Python 3.7. When using data classes, you don't have to write boilerplate code to get proper initialization, representation, and comparisons for your objects.
Interactive Quiz
Data Classes in Python
Course
Using Python Class Constructors
Learn how class constructors work in Python. You'll also explore Python's instantiation process, which has two main steps: instance creation and instance initialization.
Interactive Quiz
Python Class Constructors: Control Your Object Instantiation
Course
Using Multiple Constructors in Your Python Classes
Learn how to provide multiple constructors in your Python classes. To this end, you'll learn different techniques, such as checking argument types, using default argument values, writing class methods, and implementing single-dispatch methods.
Course
Supercharge Your Classes With Python super()
Learn how to leverage single and multiple inheritance in your object-oriented application to supercharge your classes with Python super().
Interactive Quiz
Supercharge Your Classes With Python super()
Methods and Magic
You’ve built and customized classes with data classes, constructors, and super(). Now you’ll compare instance methods, class methods, and static methods, then use magic methods to control how your objects respond to Python’s built-in operations. That includes overloading operators like + and == in your own classes.
Course
OOP Method Types in Python: @classmethod vs @staticmethod vs Instance Methods
What's the difference between @classmethod, @staticmethod, and "plain/regular" instance methods in Python? You'll know the answer after watching this video course.
Interactive Quiz
Python's Instance, Class, and Static Methods Demystified
Course
Python's Magic Methods in Classes
Learn what magic methods are in Python, how they work, and how to use them in your custom classes to support powerful features in your object-oriented code.
Interactive Quiz
Python's Magic Methods: Leverage Their Power in Your Classes
Tutorial
Operator and Function Overloading in Custom Python Classes
How to overload built-in functions and operators in your custom Python classes in order to make your code more Pythonic.
Managing Attributes
Magic methods let you shape how your objects behave. Attributes need the same kind of control, so next you’ll look at getters and setters and when they’re actually needed in Python. Then you’ll use property() to turn plain attributes into managed ones that validate or compute their values.
Course
Getters and Setters in Python
Learn what getter and setter methods are, how Python properties are preferred over getters and setters when dealing with attribute access and mutation, and when to use getter and setter methods instead of properties in Python.
Interactive Quiz
Getters and Setters: Manage Attributes in Python
Course
Managing Attributes With Python's property()
Learn how to create managed attributes, also known as properties, using Python's property() in your custom classes.
Interactive Quiz
Python's property(): Add Managed Attributes to Your Classes
Inheritance and Design Patterns
With attribute access under control, you’re ready to build relationships between classes. You’ll reuse and extend behavior through inheritance, composition, and mixin classes, and see how Python resolves attributes across a class hierarchy. Finally, you’ll put that to work with the Factory Method pattern and the SOLID design principles.
Course
Inheritance and Internals: Object-Oriented Programming in Python
Learn about the various types of inheritance that you can use to write object-oriented code in Python. These include class inheritance, multilevel inheritance, and multiple inheritance, along with special methods and abstract base classes.
Course
Inheritance and Composition: A Python OOP Guide
Learn about inheritance and composition in Python. You'll improve your object-oriented programming (OOP) skills by understanding how to use inheritance and composition and how to leverage them in their design.
Interactive Quiz
Inheritance and Composition: A Python OOP Guide
Course
Understanding Mixin Classes in Python
Learn how to write reusable Python mixin classes, distinguish them from abstract base classes, and steer clear of common pitfalls.
Interactive Quiz
What Are Mixin Classes in Python?
Course
Implementing the Factory Method Pattern in Python
Learn how to use the Factory Method pattern in Python, when to apply it, how to refactor your code for it, and explore a reusable implementation.
Interactive Quiz
The Factory Method Pattern and Its Implementation in Python
Course
Design and Guidance: Object-Oriented Programming in Python
Learn about the SOLID principles, which are five well-established standards for improving your object-oriented design in Python. By applying these principles, you can create object-oriented code that is more maintainable, extensible, scalable, and testable.
Interactive Quiz
SOLID Design Principles: Improve Object-Oriented Code in Python
Want Live, Expert-Led Guidance?
Take your Python skills further with a structured, instructor-led course that covers the same topics in depth. You’ll get live Q&A and work on hands-on projects throughout.
Intermediate Python Deep Dive Course
An 8-week live course covering OOP in depth: classes, special methods, data classes, inheritance, composition, and design patterns. Learn with hands-on projects and expert guidance.
Test Your Knowledge
You’ve made it through the entire path! In the wrap-up quiz below, you’ll revisit the most important ideas about classes, inheritance, properties, magic methods, mixins, and SOLID design principles. Use it to spot any topics that still feel rusty before moving on.
Interactive Quiz
Object-Oriented Programming (OOP) in Python
Test your Python OOP skills with this wrap-up quiz covering classes, inheritance, magic methods, properties, mixins, and SOLID design principles.
Congratulations on completing this learning path! You’ve learned how Python’s object-oriented programming works, from defining and customizing classes with data classes, constructors, and super() to controlling behavior with magic methods and managed attributes. You’ve also worked through inheritance, composition, mixin classes, the Factory Method pattern, and the SOLID principles.
Continue your intermediate Python journey with the next learning path:
Learning Path
Files and File Streams
13 Resources ⋅ Skills: Python, Pathlib, File I/O, Serialization, Encoding, Unicode, PDF, WAV, Context Managers, ZIP Files
You might also be interested in these related learning paths:
Got feedback on this learning path?
Looking for real-time conversation? Visit the Real Python Community Chat or join the next “Office Hours” Live Q&A Session. Happy Pythoning!