Happy 1st of September!
I have decided to write a letter to you and share some thoughts and gratitude for your visits.
I recently walked into my favorite park and saw beautiful white pigeons picking some worms.
They were mingling without any concern with other “usual” pigeons. They looked so different but were also quite indifferent
to their differences from each other. At the same time, they were pigeons who did not care about feather color differences.
They all enjoyed green grass and little worms in it.
Birds are so beautiful, all of them.
And I have decided to do a simple wrap-up of simple Python classes defining birds and pigeons.
I think that this post is a good recap or start for
understanding Object-Oriented Programming and the available functionality in Python.
Table of Contents
Object-Oriented Programming (OOP) in Python
Object-Oriented Programming (OOP) is a programming paradigm that organises code around objects — bundles of data (attributes) and behaviour (methods) defined by classes. In Python, OOP lets you model any real-life or abstract entity as a reusable class and create many independent instances from it.
There are several programming paradigms in computer science, and writing code is the best way to actually understand them. This post focuses on Object-Oriented Programming: as the name suggests, we deal with objects, describing real-life or abstract things with classes.
For instance, birds. We can define a class for birds and also define a class for pigeons. Both classes will be similar, right?
And with Python and OOP we can describe birds and pigeons very neatly and create many instances of both classes,
thus creating many bird objects defined by both classes!
Defining Classes in Python with init
🔒 Subscribe to keep reading.
Class Methods in Python: Defining Object Behaviour
🔒 Subscribe to keep reading.
Inheritance in Python: Reusing a Parent Class
🔒 Subscribe to keep reading.
Polymorphism in Python: Overriding Inherited Methods
🔒 Subscribe to keep reading.
Encapsulation in Python: Protected and Private Variables
🔒 Subscribe to keep reading.
Conclusion: Python OOP Concepts Summary
🔒 Subscribe to keep reading.
References
🔒 Subscribe to keep reading.
You've hit a Deep Dive tutorial.
I spend dozens of hours researching, coding, and breaking things to write these guides. This content is free, but reserved for my subscriber community. Drop your email below to unlock this guide (and all past/future deep dives):
Full content temporarily unavailable — refresh in a moment
Already a subscriber? Use the magic link from your last newsletter, or reset your password.
Log in to unlock
New subscribers get an inbox mail: Set a password to unlock articles. The form does not log you in — use the same email afterwards.