Elevate Your Python: Harnessing the Power of Abstract Base Classes (ABCs)

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)

Exploring the Role of Static Methods in Python: A Functional Perspective

Introduction Python’s versatility in supporting different programming paradigms, including procedural, object-oriented, and functional programming, opens up a rich landscape for software design and development. Among these paradigms, the use of static methods in Python, particularly in an object-oriented context, has been a topic of debate. This article delves into the role and implications of static… Continue reading Exploring the Role of Static Methods in Python: A Functional Perspective

Your First Python Open Source Contribution: A Step-By-Step Guide

Introduction I recently re-engaged with one of my open source projects and it was a rewarding experience. 🎉 It was a Pybites project I had written the core for years ago, but thanks to some amazing Pythonistas in our community it became a way more mature tool so I had to get acquainted again. I… Continue reading Your First Python Open Source Contribution: A Step-By-Step Guide

⚠️Why you should avoid import * in Python 🐍

Anyone who’s worked with Python knows that modules can be a Godsend, saving you time, effort, and many lines of code. They even have namespacing built-in 💪 😍 To expand on this a bit: However, not all ways of using modules are equally beneficial. In this article, we will discuss why using import * can… Continue reading ⚠️Why you should avoid import * in Python 🐍

How the Flocking Rules Can Help You Refactor Your Code

In this new podcast episode we are excited to have Chris May back to delve deeper into the intricacies of refactoring. Watch here: Listen here: We talk about the significance of the Flocking Rules, a set of guidelines derived from “99 Bottles of OOP” by Sandi Metz and Katrina Owen.  These rules provide developers with… Continue reading How the Flocking Rules Can Help You Refactor Your Code

The Arbitrary (Keyword) Arguments (args and kwargs) don’t come “for free” in Python

Python allows you to use *args and **kwargs in function definitions to accept an arbitrary number of positional and keyword arguments, respectively. Here is a simple example: Different types of function arguments In the above example, the arbitrary_args function is defined to accept any number of positional and keyword arguments using the *args and **kwargs… Continue reading The Arbitrary (Keyword) Arguments (args and kwargs) don’t come “for free” in Python