Introduction Two weeks ago I wrote an article about ABCs and interface enforcement. Shortly after I learned that you can do this as well with protocols. Python 3.8 introduced quite a groundbreaking feature that further advanced the language’s capabilities in type checking: the typing.Protocol which allows Python developers to define and enforce interface contracts in… Continue reading Leveraging typing.Protocol: Faster Error Detection And Beyond Inheritance
Articles on OOP
Elevate Your Python: Harnessing the Power of Abstract Base Classes (ABCs)
By Bob Belderbos on 26 January 2024
Introduction One cool object-oriented programming (OOP) technique / pattern is enforcing consistent interfaces. In Python you can use Abstract Base Classes (ABCs) for that. 🐍 Using ABCs ensures that all subclasses implement the required methods. This can make it easier to maintain and extend the existing code base. Update Feb 2024: you can also leverage… Continue reading Elevate Your Python: Harnessing the Power of Abstract Base Classes (ABCs)
When to Write Classes in Python And Why it Matters
By Bob Belderbos on 25 April 2020
When people come to Python one of the things they struggle with is OOP (Object Oriented Programming). Not so much the syntax of classes, but more when and when not to use them. If that’s you, read on. In this article I will give you some insights that will get you clarity on this.
Refactoring Opportunities That Will Boost the Quality of Your Code
By Bob Belderbos on 19 April 2020
Refactoring is all about making your code more maintainable. In this article I will provide you with Python and generic software tips to write better code.
PyBites Twitter Digest – Issue 01, 2019
By PyBites Team on 17 February 2019
It has been too long but we’re excited to bring you today: PyBites Twitter Digest – Issue 01, 2019
Twitter Digest 2018 Week 09
By PyBites Team on 25 February 2018
Every weekend we share a curated list of 15 cool things (mostly Python) that we found / tweeted throughout the week.
OOP Beyond the Basics: Using Properties for Encapsulation, Computation and Refactoring
By Bob Belderbos on 31 May 2017
In this article I share my learning of the property decorator coding a simple Account class. I think it’s an unmissable tool in your (Python) OOP toolkit.
Code Challenge 20 – Object Oriented Programming Fun – Review
By PyBites Team on 29 May 2017
It’s review time again. Wow: challenge #20 already! We can’t believe we have worked through so many already. We also keep receiving amazing PRs, awesome!
Code Challenge 20 – Object Oriented Programming Fun
By PyBites Team on 22 May 2017
Hi Pythonistas, a new week, a new ‘bite’ of Python coding! This week we will let you experiment with Object Oriented Programming, an important skill and fundamental building block of (everthing-is-an-object) Python. Enjoy!
Twitter digest 2017 week 07
By PyBites Team on 18 February 2017
On Saturdays we will share a curated list of 15 cool things (mostly Python) we found / tweeted during the week.