Understanding the Complexity of Metaclasses and their Practical Applications

Metaprogramming is a collection of programming techniques which focus on ability of programs to introspect themselves, understand their own code and modify themselves. Such approach to programming gives programmers a lot of power and flexibility. Without metaprogramming techniques, we probably wouldn’t have modern programming frameworks, or those frameworks would be way less expressive.  This article is an excerpt from the book, Expert Python Programming, Fourth Edition by Michal Jaworski and Tarek Ziade – A book that expresses many years of professional experience in building all kinds of applications […]

Read more

What is Liskov’s Substitution Principle?

In this article, we will explore the Liskov’s substitution principle, one of the SOLID principles and how to implement it in a Pythonic way. The SOLID principles entail a series of good practices to achieve better-quality software. In case some of you aren’t aware of what SOLID stands for, here it is: S: Single responsibility principle O: Open/closed principle L: Liskov’s substitution principle I: Interface segregation principle D: Dependency inversion principle The goal of this article is to implement proper […]

Read more