Python

A collection of 13 Posts

Explore Python dependencies with `pipdeptree` and `uv pip tree`

Finding dependencies in a project in tree form, including some great extra info

Polite lazy imports for Python package maintainers

Allow people to import just the part of your package that they need, when they need it.

Python lazy imports you can use today

There's a proposal for Python to natively support lazy importing starting in Python 3.15. However, there are techniques covered in this post that allow you to use lazy importing now with 3.13, 3.12, ... really every version of Python.

Installing Python 3.14 on Mac or Windows

The easiest way to install Python 3.14 (or 3.13, 3.12, 3.11, 3.10,...). Includes descriptions for installing from both python.org and using uv.

Testing against Python 3.14

Steps I take for updating a project for running and testing on Python 3.14

Testing argparse Applications

CLI testing can be tricky, we unravel it for argparse apps

Upgrading to Python 3.12 and my battle with virtualenv cache

Recapping some troubles I had when upgrading

Fixing Circular Imports in Python with Protocol

Quick tutorial with example

Testing with Python 3.12

Encouraging people to test

Pinning Application Dependencies with pip-tools compile

Pinning dependencies

tip: dictionary get() works like getattr

Default values with dict

I’m annoyed with Python’s ternary operator

rant

Python regex Search and Replace Examples

How I use search and replace in Python