Python Quality Tools for Juniors: Ruff & Mypy

Your code runs — that doesn’t mean it’s correct. These two tools catch problems before they become bugs. The Problem: […]
Python Testing – Unit Tests, Pytest, and Best Practices

Writing tests ensures that your code works as expected and helps prevent bugs from creeping into your applications. Python provides […]
Python Internals: Reference Cycles and Garbage Collection

Understanding reference counting, garbage collection, and why your objects won’t die The Box vs. The Label Quick: what does this […]
Like LEGO? Love Python! 🧱🐍

Episode 1: Building Your First Brick (Defining Classes) Remember when you were a kid and got your first LEGO set? […]
The Two `if` Statements in Python Comprehensions

Here’s a Python comprehension that looks correct but throws a SyntaxError: # Goal: Replace negatives with 0 result = [x […]
Python’s Silent Failure: When `python -m` Does Nothing

Why You Should Care Ever run python -m your.module and get… nothing? No errors, exit code 0, but your code […]
Python Queue Example

Introduction Python’s built-in queue module is a key tool when you need safe data passing between threads or processes. Yet […]
Python’s __mro__

Python’s __mro__ (Method Resolution Order) is a crucial concept that determines how Python looks up methods in inheritance hierarchies. Let’s […]
Understanding Python’s Memory Management: Reference Counting, Garbage Collection, and Optimization

Memory management is a critical aspect of programming, and Python handles it automatically. But how does it work behind the […]
Python Sets: remove() vs discard()

Python sets have two methods for removing elements: remove() and discard(). They look identical: colors = {“red”, “green”, “blue”} colors.remove(“green”) […]