mathspp blog

428 460,674 38,250
articles words lines of code

Dip your toes in metaprogramming and learn about __init__'s big brother, the dunder method __new__.

Play this short Python quiz to test your Python knowledge!

Today I learned how to set different thousands separators using string formatting.

In this article I share my personal highlights of the 2025 edition of the PyCon US conference,.

This article shows the small script I use to automatically push code changes while live coding in talks or classes, improved with uv.

Today I learned that the module builtins grows dynamically in the REPL.

Today I learned you can use uv to install CLI tools with extra dependencies.

This article gives an overview of the tools available in the module enum and how to use them.

Today I learned how to use uv to escape uv and go back to using venv and pip for a given project.

Today I learned how to detect collisions between circles and rectangles with 100% accuracy.

This article proposes an implementation of an ergonomic binary search algorithm implemented as a bidirectional generator.

This tutorial walks you through implementing a 2D scrolling game in JavaScript.

Today I learned how to create co-authored commits on GitHub.

Today I learned how to quickly switch back and forth between two different git branches.

Today I learned how to publish a Python package to PyPI with uv.

This is a short account of how I wrote a program that solves all LQueens puzzles from LinkedIn automatically with Python.

The 10th article of this series adds support for elif and else statements.

This practical tutorial shows how to use uv to build and install custom Python CLI applications globally on your system.

You can ignore exceptions with contextlib.suppress and in this article I show why this is preferred over try: ... except: pass.

Today I learned that I can use the percent sign to run commands from inside Jupyter notebooks.