Finding the Best Posts

See my top posts page for a selection of my best posts. Or search the site with Duck Duck Go:

Recent Posts

Django-related Deals for Black Friday and Cyber Monday

Trumpets go doot-doot-de-doot!

Here are some Django-related deals for this year’s Black Friday (26th Nov) and Cyber Monday (29th Nov), including my own. I may learn of more by that date, so check back later!


The Well-Maintained Test: 12 Questions for New Dependencies

A well-maintained bicycle.

Joel Spolsky’s infamous Joel Test is a quick heuristic test for checking a software engineering team’s technical chops. I’ve come up with a similar test that we can use to decide whether a new package we’re considering depending on is well-maintained.


Software Engineering Is Programming Integrated Over Time

What program walks on four legs in the morning, …?

The preface of Software Engineering at Google opens with this thesis:


Python Type Hints - How to Type a Descriptor

Now invoking The Scroll of Descriptors.

The descriptor protocol allow us to completely customize attribute access. Python’s documentation describes the protocol with types involved described with words. Let’s look at how we can write those as type hints.


A Python Script Template with Sub-commands (and Type Hints)

Now there are two of them!

Earlier this week I shared my Python script template. Here’s an extended version with sub-command support, and an example script.


How to Create a Transparent Attribute Alias in Python

“You don’t know my secret alias,” said the hedgehog.

When dealing with evolvng API’s, it may be useful to rename an attribute in a class, but keep the old name around for backwards compatibility. This would mean making one attribute an alias for another. In this post we’ll look at two ways to achieve this.


Three more uses for functools.partial() in Django

I remain partial to a plant-scroll.

I remain convinced that Python’s functools.partial() is underappreciated. Following my previous post, here are three more ways to use partial() with Django.


The Many Ways to Exit in Python

Show me the exit

It’s fundamentally useful to exit your program when it’s done. Here are five(!) ways to do so in Python.


A Python Script Template, with and without Type Hints and Async

Read on for a “cat trick”!

Python is great for writing scripts for the command line. In this post we’ll look at my script template, an example script, and some alternative versions (without type hints, and in async flavour).


Tips for debugging with print()

A machine of much printing.

If you’re embarrassed at debugging with print(), please don’t be - it’s perfectly fine! Many bugs are easily tackled with just a few checks in the right places. As much as I love using a debugger, I often reach for a print() statement first.